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

Matthew Johnson matthew at anandabits.com
Mon Jul 25 15:28:06 CDT 2016


> On Jul 25, 2016, at 3:22 PM, Nate Cook via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> 	https://github.com/apple/swift-evolution/blob/master/proposals/0132-sequence-end-ops.md
> 
> First, a big thanks to Brent for all the work in categorizing, describing, and justifying all these changes! I'm largely in favor of the new method names—several of the renamings lead to better grouping of related methods, and I think the compromises that have been made make lots of sense.
> 
> However, I'm not in favor of replacing the existing slicing methods with new subscript syntax that uses partial ranges. These represent a significant new vernacular for Swift that none of us has used before in the language. I'm additionally worried about the discoverability and clarity of this kind of slicing. In the other languages I've used that support similar kinds of subscripting, it always seems too clever by half—fussy to write and frequently confusing to read.
> 
> At this late date, I propose keeping the slicing methods (i.e., prefix(upTo:), prefix(through:), and suffix(from:)) and considering adopting the new slicing-via-subscript syntax in a future proposal.

This seems like a reasonable alternative.  The slicing / subscript syntax can reasonably be viewed as sugar for the named methods.

> 
> Best,
> Nate
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list