On 22.03.2017 17:37, Ricardo Parada wrote:


On Mar 22, 2017, at 9:30 AM, Vladimir.S <[email protected]> wrote:

let path = @Bag.things[0].name

bag@path
[email protected][0].name
[email protected][0].name
bag.things[0]@.name
bag.things[0]@Thing.name

It sounds like the @ character is serving two different purposes which confused 
me at first.

If I understood correctly, you are using it to get the key path but also to 
apply the key path to the bag struct and get the corresponding value.


Yes. And the initial proposal suggest the following syntax accordingly:

let path = Bag.things[0].name
bag[path]
bag[.things[0].name]
bag[Bag.things[0].name]
bag.things[0][.name]
bag.things[0][Thing.name]
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to