[swift-evolution] [Draft] Rationalizing Sequence end-operation names

Sean Heber sean at fifthace.com
Tue Jul 5 14:02:35 CDT 2016


That’s pretty neat - although I’d inevitably forget and end up writing it with spaces between the “arguments" and the “operator”:

someCollection[* … idx]

But maybe even that could be made to work with some cleverness.

l8r
Sean


> On Jul 5, 2016, at 1:45 PM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
> 
> on Sun Jul 03 2016, Nevin Brackett-Rozinsky <swift-evolution at swift.org> wrote:
> 
>> The incomplete range concept is quite intriguing.
>> 
>> Have we considered spelling the operators with an asterisk at the
>> incomplete end?
>> prefix *..<
>> prefix *...
>> postfix ...*
>> postfix ..<*
>> 
>> That way the use-sites would look like:
>> someCollection[*..<idx]
>> someCollection[*...idx]
>> someCollection[idx...*]
>> someCollection[idx..<*]
>> 
>> From a “first-glance” perspective, the asterisk “looks like” a wildcard
>> placeholder, which should help readers and writers of code to understand
>> the meaning.
>> 
>> And from a future language development standpoint, we’ll keep the
>> triple-dot spelling available for whatever needs may arise (tuple
>> splatting, variadic generics, etc.)
>> 
>> Thoughts?
> 
> That's an interesting possiblity, IMO.
> 
> -- 
> Dave
> 
> _______________________________________________
> 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