New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-125] Add rotate algorithm #42747
Comments
One of the implementations of rotate (for bidirectional collections) is implemented using a reverse in place algorithm—would that be a good one to add to the public API as well? |
I don't see why not. |
Comment by Félix Fischer (JIRA) Hey Nate, are you still working on this? I can take it for you ^^ |
Comment by Félix Fischer (JIRA) I just realised that your comments were from 2016 XD Then, I'll take it |
Hi Felix - thanks for looking at this! There's an implementation of rotate in test/Prototypes/Algorithms.swift.gyb. You can take a look at that - there are a couple different approaches. In any case, to add this to the standard library would require a Swift Evolution proposal. If you're interested in submitting one of those, you'll want to take a look at the one that was rejected for Swift 3 and the rationale there. |
Resetting assignee for all Starter Bugs not modified since 2018. |
Comment by Hariesh Jayanthan (JIRA) I believe rotate has been implemented in this file. |
That's what it might look like, but that's not part of the standard library yet. (Notice it's under test/.) |
Comment by Hariesh Jayanthan (JIRA) Ahhh sorry about that. I don't know how I didn't notice. |
@natecook1000 I have taken a look at your Swift Evolution proposal. This seems like a pretty interesting issue to start with! Would you be ok with me picking this up where you left it? I would love to apply another proposal taking into account all the feedback received in the review |
Where would this algo go to, I mean in which file should this be implemented in? |
See earlier comments for tips. This needs an evolution proposal, by the way. If you are interested, I suggest reading though the previous proposal and its review stages. |
Additional Detail from JIRA
md5: ccc424105bba16b3f829a36e196fe08d
Issue Description:
Swift needs a rotate algorithm, equivalent to
std::rotate()
in C++.The text was updated successfully, but these errors were encountered: