<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 29, 2017, at 6:32 PM, Brent Royal-Gordon <<a href="mailto:brent@architechies.com" class="">brent@architechies.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class="">On Mar 29, 2017, at 6:21 PM, Jonathan Hull 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="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><blockquote type="cite" class="" style="font-family: Helvetica; font-size: 12px; 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=""><span class="" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">I would love it if we found a way to retain something as concise as that shorthand. I'm working on a library where users will specify a collection of key paths pairs. This shorthand would be a very nice piece of sugar making the code expressing these collections (usually literals) quite a bit more readable.</span></div></blockquote></div><br class=""><div class="">+1 for this. I think it will be somewhat common to pass around arrays of these things, and a shorthand syntax of some sort would make that nicer. That said, I don’t want to slow down the proposal, since I will be using this feature the very second it becomes available.</div></div></div></blockquote><br class=""></div><div class="">Agreed.</div><div class=""><br class=""></div><div class="">One more thought on this: I don't think anyone really likes the #keyPath(Type, .key1.key2)` syntax; it's just the best we've come up with. If the syntax were instead this:</div><div class=""><br class=""></div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>#keyPath(Type).key1.key2</div><div class=""><br class=""></div><div class="">I think that would look cleaner and avoid drawing distinctions based on subtle punctuation differences. I don't think it would clash with old-style key paths since you can't have a key path to a type name anyway. And support for the leading-dot syntax would fall out of it quite naturally.</div></div></div></blockquote></div><br class=""><div class="">I could get behind that (although it would stop us from extending KeyPaths). One question in both cases: How do we represent keyPaths for static properties?</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Jon</div></body></html>