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

Nate Cook natecook at gmail.com
Mon Jul 25 15:22:39 CDT 2016


> 	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.

Best,
Nate



More information about the swift-evolution mailing list