[swift-evolution] [SHORT Review] SE-0132: Rationalizing Sequence end-operation names

Pyry Jahkola pyry.jahkola at iki.fi
Mon Jul 25 15:46:37 CDT 2016

> On 25 Jul 2016, at 09:10, Chris Lattner via swift-evolution <swift-evolution at swift.org> wrote:
> Hello Swift community,
> The review of "SE-0132: Rationalizing Sequence end-operation names" begins now and runs through July 26.  Apologies for the short review cycle, but we’re right up against the end of source breaking changes for Swift 3.  The proposal is available here:
> 	https://github.com/apple/swift-evolution/blob/master/proposals/0132-sequence-end-ops.md
> 	* What is your evaluation of the proposal?

+1 to the method renames.
-1 to the slice syntax proposed.

I find the introduction of unary operators confusing. I don't think it's good design that you need to remove a space when moving from the old syntax to the new one:

    array[array.startIndex ..< someIndex] // before
    array[..<someIndex]                   // after

and likewise, that you need to add parentheses here:

    array[array.startIndex ..< someIndex - 1] // before
    array[..<(someIndex - 1)]                 // after

OTOH, I would be okay if the proposal didn't implement unary operators but only the Optional<Index> overloads of `...` and `..<`:

    array[nil ..< someIndex]     // first example
    array[nil ..< someIndex - 1] // second example

That said, maybe it's best to defer that part of the proposal until a later time and stick to prefix(upTo:), prefix(through:), and suffix(from:) for now.

> 	* Is the problem being addressed significant enough to warrant a change to Swift?


> 	* Does this proposal fit well with the feel and direction of Swift?


> 	* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?


> 	* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

Quick reading.

Thanks to Brent for the effort!

— Pyry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160725/8321a007/attachment.html>

More information about the swift-evolution mailing list