<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* What is your evaluation of the proposal?<br></blockquote><div><br></div><div>+1. A very useful function to have on collections.</div><div><br></div><div>In FORTRAN and in languages that take inspiration from it, the same function is called a "circular shift"--IMO, it's a clearer name both by its associations with other uses of the term "shifting" and because googling the term will give much more useful results.</div><div><br></div><div>IMO, the parameter label could also use some bikeshedding. One reason is that, with an `Array<Int>` (as illustrated in the examples given), the argument in `array.rotate(firstFrom: 5)` does not obviously refer to an index. Superficially, this could mean first from the first element equal to 5.</div><div><br></div><div>One suggestion I would put forward is: `circularShift(leftBy: IndexDistance)`. For bidirectional and random access collections, this function could possibly be complemented by `circularShift(rightBy: IndexDistance)`.</div><div><br></div><div>Finally, I wonder whether the C++11-like behavior of returning the new index of the former first item is a very Swifty behavior. I could be persuaded if the return value is demonstrably something that is not always trivial to compute.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* Is the problem being addressed significant enough to warrant a change to Swift?<br></blockquote><div><br></div><div>It's an additive feature, and it's hard to see any drawbacks.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* Does this proposal fit well with the feel and direction of Swift?<br></blockquote><div><br></div><div>Yes, it's an algorithm of appropriate complexity and general utility to be added to the stdlib.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br></blockquote><div><br></div><div>This proposal presents the same algorithm as found in other languages but borrows the name from C++. Other names may be more self-documenting (see above).</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br></blockquote><div><br></div><div>I have read the proposal to a medium depth.</div></div></div></div>