<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div></div><div><br></div><div><br>On Dec 2, 2017, at 11:46 PM, Jean-Daniel <<a href="mailto:mailing@xenonium.com">mailing@xenonium.com</a>> wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">Le 3 déc. 2017 à 04:58, Jose Cheyo Jimenez via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</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="">Hi Chris, <div class=""><br class=""></div><div class="">Thank you for pushing this forward.</div><div class=""><br class=""></div><div class="">My only comment is that on the declaration side it would be great to also have an attribute to communicate that compiler magic is happening.</div><div class=""><br class=""></div><div class="">Currently it is surprising that a regular looking protocol is providing me so much power.</div><div class=""><br class=""></div><div class="">Suggestions: </div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255); background-color: rgb(255, 255, 255);" class="">@dynamic</div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(52, 149, 175); background-color: rgb(255, 255, 255);" class=""><span style="color: #0433ff" class="">struct</span><span style="" class=""> PyVal : </span>MemberLookupProtocol<span style="" class=""> {...}</span></div><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(4, 51, 255); background-color: rgb(255, 255, 255);" class="">@dynamic</div><div style="margin: 0px; line-height: normal; font-family: Menlo; background-color: rgb(255, 255, 255);" class=""><span style="color: #0433ff" class="">struct</span> ParameterSummer : <span style="color: #3495af" class="">DynamicCallable</span> {...}</div><div style="margin: 0px; line-height: normal; background-color: rgb(255, 255, 255); min-height: 14px;" class=""><br class=""></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(0, 143, 0); background-color: rgb(255, 255, 255);" class="">// Error: This type needs the @dynamic attribute.</div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(52, 149, 175); background-color: rgb(255, 255, 255);" class=""><span style="color: rgb(4, 51, 255);" class="">class</span><span style="" class=""> ParamWinter : </span>MyCustomCallableProtocolOrClassOrTypeAlias<span style="" class=""> {...}</span></div></div><div class=""><br class=""></div><div class="">By requiring @dynamic (Or other attribute name), people can know that this is a compiler dynamic declaration and not just some random protocol whose name starts with Dynamic*. :)</div><div class=""><br class=""></div></div></div></blockquote><div><br class=""></div><div>I’m not fond of the idea of an attribute. This introduce redundancy. </div></div></div></blockquote><br><blockquote type="cite"><div><div><div>What a declaration means if the attribute is missing ? </div></div></div></blockquote><div>Won’t compile?</div><br><blockquote type="cite"><div><div><div>What this attribute will mean on an other declaration ?</div></div></div></blockquote>Won’t compile?<div><br></div><div>It would be similar to the swift 4 mode where @objc is required in some declarations. </div><div><br></div><div><br><blockquote type="cite"><div><div><div>If this attribute must be used with the declaration and it can’t be used with an other one, then what is the point of having an attribute but to exercice the compiler fixit feature </div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">@NSManagedObject is another example I like from Core Data.</div><div class=""><a href="https://useyourloaf.com/blog/core-data-code-generation/" class="">https://useyourloaf.com/blog/core-data-code-generation/</a></div></div></div></blockquote><br class=""></div><div>@NSManageObject apply to normal declarations that have a different meaning when this attribute is not present.</div><div><br class=""></div><br class=""></div></blockquote></div></body></html>