[swift-evolution] Change subscripts to use colons

James Froggatt james.froggatt at me.com
Mon Jul 11 14:32:53 CDT 2016


Interesting way to think of the ‘->’ operator.

Perhaps a <-> operator could represent this two-way mapping?

> On 11 Jul 2016, at 20:29, Erica Sadun <erica at ericasadun.com> wrote:
> 
> On Jul 11, 2016, at 1:21 PM, James Froggatt via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> Thanks for letting me know this has been tried before, I'm actually in the process of drafting the proposal now.
> 
> I'd hesitate to try to do something off-beat and "blend" them but it amuses me no end that the :-> operator looks so very happy.
> 
> subscript(_ position: Int) inout :-> Element { get { … } set { … } }
> 
> Nonetheless, I do want to point out that unlike properties, subscripts provide a mapping between a domain and a range so it feels more natural to me to use -> than :.
> 
> -- E
> 
> 
> 

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


More information about the swift-evolution mailing list