<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 22, 2017, at 10:36 AM, Vladimir.S via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">On 22.03.2017 17:37, Ricardo Parada wrote:<br class=""><blockquote type="cite" class=""><br class=""><br class=""><blockquote type="cite" class="">On Mar 22, 2017, at 9:30 AM, Vladimir.S <<a href="mailto:svabox@gmail.com" class="">svabox@gmail.com</a>> wrote:<br class=""><br class="">let path = @Bag.things[0].name<br class=""><br class="">bag@path<br class="">bag@.things[0].name<br class=""><a href="mailto:bag@Bag.things" class="">bag@Bag.things</a>[0].name<br class="">bag.things[0]@.name<br class="">bag.things[0]@Thing.name<br class=""></blockquote><br class="">It sounds like the @ character is serving two different purposes which confused me at first.<br class=""><br class="">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.<br class=""><br class=""></blockquote><br class="">Yes. And the initial proposal suggest the following syntax accordingly:<br class=""><br class="">let path = Bag.things[0].name<br class="">bag[path]<br class="">bag[.things[0].name]<br class="">bag[Bag.things[0].name]<br class="">bag.things[0][.name]<br class="">bag.things[0][Thing.name]<br class=""></div></div></blockquote><div><br class=""></div><div># makes a lot more sense than @ as a sigil. It follows from #selector and #keyPath. These are the most similar language features right now where the compiler produces special values. I think it’s also worth noticing that values produced by #selector and #keyPath are <i class="">used</i> in normal ways. There is no magic syntax for their use, just a typed value. If we’re going to make a change we should use # instead of `.` for accessing these special values but we should stick with subscript for use.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></div></blockquote></div><br class=""></body></html>