<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=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class=""><i class="">What is your evaluation of the proposal?</i></span><div class=""><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><span style="background-color: rgb(255, 255, 255);" class=""><br class=""></span></font></div><div class="">Strong yes.</div><div class=""><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><span style="background-color: rgb(255, 255, 255);" class=""><br class=""></span></font></div><i class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">Is the problem being addressed significant enough to warrant a change to Swift?</span></i><div class=""><i class=""><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><span style="background-color: rgb(255, 255, 255);" class=""><br class=""></span></font></i></div><div class="">At Delicious we wrote a huge ugly macro set to&nbsp;define properties in a special way so we could make&nbsp;key paths safely:</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">// Declares a safe-KVC-accessible property</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">// Use as: @property (opts) MyType KVC(*name);</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">// Use as: @property (opts) MyType KVC2(*firstName, *lastName);</span></div><div style="margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#define KVC(a) \</span></div><div style="margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; a; SAFE_KVC(a)</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#define SAFE_KVC(NAME) \</span></div><div style="margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; void NAME ## $DMSafeKVC(void)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#define K(x) \</span></div><div style="margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; __builtin_choose_expr(sizeof(&amp;x ## $DMSafeKVC), @#x, @</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"_NOT_A_KEY_"</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">So you could then use K(title) for example in your code and get what would now be #keyPath(title) in this proposal.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">And we also had:</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">#define KeyPath(...) \</span></div><div style="margin: 0px; line-height: normal; color: rgb(120, 73, 42);" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; DMMakeKeyPath(__VA_ARGS__, nil)</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">NSString</span><span style="font-variant-ligatures: no-common-ligatures" class=""> *DMMakeKeyPath(</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">NSString</span><span style="font-variant-ligatures: no-common-ligatures" class=""> *firstKey, ...)</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">{</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">NSMutableArray</span><span style="font-variant-ligatures: no-common-ligatures" class=""> *keyArray = [</span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">NSMutableArray</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">arrayWithObject</span><span style="font-variant-ligatures: no-common-ligatures" class="">:firstKey];</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">va_list</span><span style="font-variant-ligatures: no-common-ligatures" class=""> varargs;</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #78492a" class="">va_start</span><span style="font-variant-ligatures: no-common-ligatures" class="">(varargs, firstKey);</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">NSString</span><span style="font-variant-ligatures: no-common-ligatures" class=""> *nextKey = </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">nil</span><span style="font-variant-ligatures: no-common-ligatures" class="">;</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">while</span><span style="font-variant-ligatures: no-common-ligatures" class=""> ((nextKey = </span><span style="font-variant-ligatures: no-common-ligatures; color: #78492a" class="">va_arg</span><span style="font-variant-ligatures: no-common-ligatures" class="">(varargs, </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">__unsafe_unretained</span><span style="font-variant-ligatures: no-common-ligatures" class=""> NSString *)))</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; &nbsp; &nbsp; [keyArray </span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">addObject</span><span style="font-variant-ligatures: no-common-ligatures" class="">:nextKey];</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #78492a" class="">va_end</span><span style="font-variant-ligatures: no-common-ligatures" class="">(varargs);</span></div><div style="margin: 0px; line-height: normal; color: rgb(61, 29, 129);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> [keyArray </span><span style="font-variant-ligatures: no-common-ligatures" class="">componentsJoinedByString</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">:</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">@"."</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">];</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">So we could make paths.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">But this whole system was ugly as heck to read and required to you use ugly macros when defining properties AND when making key paths, so I wouldn’t use it again if I had to do it all again. I’d just like to demonstrate crazy lengths people have gone to to get SOME of this functionality.</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class="">—</span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div class="">I am curious how this proposal integrates with&nbsp;“KVO2.” Not that&nbsp;we’re talking about that here, but it’s something I imagine Apple is thinking about, so I’m not sure how much value my opinion is without knowing what’s coming.</div><div class=""><br class=""></div><div class="">(As an aside, gosh it’d be nice if other groups writing APIs had such a wonderful review process like the Swift group.)</div><div class=""><br class=""></div></span></div></span></div></span></div></span></div><div class=""><br class=""></div><div class=""><i class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">Does this proposal fit well with the feel and direction of Swift?</span></i></div><div class=""><i class=""><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><span style="background-color: rgb(255, 255, 255);" class=""><br class=""></span></font></i></div><div class="">I think so. Swift is about safety, and this make key paths much safer. And more readable as key paths instead of as strings.</div><div class=""><br class=""></div><div class=""><div class=""><br class=""></div><i class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class="">If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</span></i></div><div class=""><i class=""><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><span style="background-color: rgb(255, 255, 255);" class=""><br class=""></span></font></i></div><div class="">The horrifying one we wrote was much inferior yet we shipped a hundred thousand lines or so on it.</div><div class=""><br class=""></div><div class=""><i class=""><font color="#333333" face="Helvetica Neue, Helvetica, Segoe UI, Arial, freesans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol" size="3" class=""><span style="background-color: rgb(255, 255, 255);" class=""><br class=""></span></font></i><div class=""><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class=""><i class="">How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</i></span></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span style="color: rgb(51, 51, 51); font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 16px; background-color: rgb(255, 255, 255);" class=""><i class=""><br class=""></i></span></div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Quick reading. I’m not sure if everything in it is actually implementable and I don’t really care what the syntax is, I just want a way to do this cleanly.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Your pal,</div><div class="">-Wil</div><div class=""><br class=""></div></div></div></div></div></body></html>