[swift-evolution] [Draft] Rationalizing Sequence end-operation names
Dave Abrahams
dabrahams at apple.com
Tue Jul 5 13:45:54 CDT 2016
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
More information about the swift-evolution
mailing list