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 <[email protected]> wrote:
> 
> On Jul 11, 2016, at 1:21 PM, James Froggatt via swift-evolution 
> <[email protected] <mailto:[email protected]>> 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
> 
> 
> 

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to