<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="">Agree.<div class=""><br class=""></div><div class="">Another question. &nbsp;If `Bag` does have a static thing called `myStaticThingy` would you refer to it as:</div><div class=""><br class=""></div><div class=""><span style="font-size: 12px;" class=""><font face="Menlo" class="">Bag.Type#myStaticThingy</font></span></div><div class=""><br class=""></div><div class="">?</div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Mar 22, 2017, at 12:37 PM, Matthew Johnson &lt;<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><div class=""><br class="Apple-interchange-newline">On Mar 22, 2017, at 11:16 AM, Ricardo Parada &lt;<a href="mailto:rparada@mac.com" class="">rparada@mac.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><span class="">I see three possibilities:</span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">1) # + «</span><font face="Times New Roman" class=""><span class=""><i class="">space</i></span></font><span class="">» +«</span><font face="Times New Roman" class=""><span class=""><i class="">path</i></span></font><span class="">» like this:</span></div><div class=""><span class=""><br class=""></span></div><div class=""><font class="" face="Monaco">let path =&nbsp;#&nbsp;Bag.things[0].name</font></div><div class=""><span class=""><font face="Monaco" class="">bag[path]&nbsp;</font></span></div><div class=""><font face="Monaco" class=""><font class="">bag[</font>#&nbsp;<span class=""><font color="#979797" class="">Bag.</font>things[0].name]</span></font></div><div class=""><font face="Monaco" class=""><font class="">bag[#</font>&nbsp;.<span class="">things[0].name]</span><span class="">&nbsp;&nbsp;</span><font color="#15970a" class="">// Root is inferred as Bag</font></font></div><div class=""><font face="Monaco" class=""><font class="">bag.things[0][</font>#&nbsp;<span class=""><font color="#979797" class="">Thing.</font>name]</span></font></div><div class=""><div class=""><font face="Monaco" class=""><font class="">bag.things[0][#&nbsp;</font>.<span class="">name]&nbsp;</span><span class="" style="color: rgb(21, 151, 10);">// Root is inferred as Thing</span></font></div></div><div class=""><span class="" style="font-family: Menlo;"><br class=""></span></div><div class="">2)<span class="">&nbsp;# + «</span><font face="Times New Roman" class=""><span class=""><i class="">path</i></span></font><span class="">» like this:</span>:</div><div class=""><br class=""></div><div class=""><div class=""><font face="Menlo" class="">let path =&nbsp;#Bag.things[0].name</font></div><div class=""><span class="" style="font-family: Menlo;">bag[path]&nbsp;</span></div><div class=""><font face="Menlo" class="">bag[</font>#<span class="" style="font-family: Menlo;"><font color="#979797" class="">Bag.</font>things[0].name]</span></div><div class=""><font face="Menlo" class="">bag[#</font>&nbsp;.<font face="Menlo" class="">things[0].name] &nbsp;</font><font face="Menlo" color="#15970a" class="">// Root is inferred as Bag</font></div><div class=""><font face="Menlo" class="">bag.things[0][</font>#<span class="" style="font-family: Menlo;"><font color="#979797" class="">Thing.</font>name]</span></div><div class=""><div class=""><font face="Menlo" class="">bag.things[0][#</font>.<span class="" style="font-family: Menlo;">name] &nbsp;</span><span class="" style="color: rgb(21, 151, 10); font-family: Menlo;">// Root is inferred as Thing</span></div></div><div class=""><span class="" style="color: rgb(21, 151, 10); font-family: Menlo;"><br class=""></span></div><div class=""><div class="">3)&nbsp;<span class="">«</span><font face="Times New Roman" class=""><span class=""><i class="">Root</i></span></font><span class="">»&nbsp;</span>+&nbsp;<span class=""># +&nbsp;</span><span class="">«</span><font face="Times New Roman" class=""><span class=""><i class="">path</i></span></font><span class="">» like this:&nbsp;</span></div></div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">let path = Bag#things[0].name</font></div><div class=""><span class="" style="font-family: Menlo;">bag[path]&nbsp;</span></div><div class=""><font face="Menlo" class="">bag[</font><span class="" style="font-family: Menlo;"><font color="#979797" class="">Bag</font></span>#<span class="" style="font-family: Menlo;">things[0].name]</span></div><div class=""><font face="Menlo" class="">bag[#</font><span class="" style="font-family: Menlo;">things[0].name]</span></div><div class=""><font face="Menlo" class="">bag.things[0][#</font><span class="" style="font-family: Menlo;">name]</span></div><div class=""><font face="Menlo" class="">bag.things[0][</font><span class="" style="font-family: Menlo;"><font color="#979797" class="">Thing</font><span class="" style="font-family: Helvetica;">#</span>name]</span></div></div></div></div></blockquote><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I prefer the third option. &nbsp;I don’t think we should go with the first option. &nbsp;Allowing (or requiring) a space seems likely to be confusing. &nbsp;Both the first and the second still have potential to be confusing. &nbsp;If `Bag` has a static property named `things` people could be confused about what `#Bag.things` refers to. &nbsp;If we’re going to use a special sigil it should be positioned such that it eliminates potential for that kind of confusion.</div><br class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class=""><span class="" style="font-family: Menlo;"><br class=""></span></div><div class=""><span class="" style="font-family: Menlo;"><br class=""></span></div><div class=""><span class="" style="font-family: Menlo;"><br class=""></span></div></div><div class=""><blockquote type="cite" class=""><div class="">On Mar 22, 2017, at 11:47 AM, Matthew Johnson &lt;<a href="mailto:matthew@anandabits.com" class="">matthew@anandabits.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Mar 22, 2017, at 10:36 AM, Vladimir.S via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; 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 &lt;<a href="mailto:svabox@gmail.com" class="">svabox@gmail.com</a>&gt; 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 class=""><br class=""></div><div class=""># makes a lot more sense than @ as a sigil. &nbsp;It follows from #selector and #keyPath. &nbsp;These are the most similar language features right now where the compiler produces special values. &nbsp;I think it’s also worth noticing that values produced by #selector and #keyPath are<span class="Apple-converted-space">&nbsp;</span><i class="">used</i>&nbsp;in normal ways. &nbsp;There is no magic syntax for their use, just a typed value. &nbsp;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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></div></div></blockquote></div></div></div></blockquote></div></div></div></blockquote></div></blockquote></div><br class=""></div></body></html>