<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 4 Dec 2017, at 10:42, Vincent Esche 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 dir="ltr" class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><span style="font-size:12.800000190734863px" class="">I think the argument basically is "let's not add another footgun" (because the design of Swift , for example regarding null handling, is to have less footguns than other languages). The fact that there are footguns in swift isn't an argument for adding new ones.</span></blockquote><div class=""><br class=""></div><div class="">Couldn’t have said it better. This is what it all boils down to.</div></div></div></blockquote><div><br class=""></div><div>I would definitely not go as far as calling this proposal a language footgun.</div><br class=""><blockquote type="cite" class=""><div class=""><div class="gmail_extra"><div class="gmail_quote">On Mon, Dec 4, 2017 at 12:16 AM, Benjamin G via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Sun, Dec 3, 2017 at 8:26 PM, Chris Lattner via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Dec 3, 2017, at 11:03 AM, Magnus Ahltorp &lt;<a href="mailto:map@kth.se" target="_blank" class="">map@kth.se</a>&gt; wrote:<br class="">
&gt;<br class="">
&gt;&gt; 4 Dec. 2017 02:40 Chris Lattner via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt; wrote:<br class="">
&gt;&gt;<br class="">
&gt;&gt; That’s a good principle.&nbsp; However, a dynamic member lookup is just a member lookup.&nbsp; By that principle, it should look like a member lookup :-)<br class="">
&gt;&gt;<br class="">
&gt;&gt; Further, I incorporated some of the conversation with Matthew into the proposal, showing how adding even a single sigil to dynamic member lookup to distinguish it is problematic:<br class="">
&gt;&gt; <a href="https://gist.github.com/lattner/b016e1cf86c43732c8d82f90e5ae5438#increasing-visibility-of-dynamic-member-lookups" rel="noreferrer" target="_blank" class="">https://gist.github.com/lattne<wbr class="">r/b016e1cf86c43732c8d82f90e5ae<wbr class="">5438#increasing-visibility-of-<wbr class="">dynamic-member-lookups</a><br class="">
&gt;&gt;<br class="">
&gt;&gt; Further, adding something like .dynamic would completely undermind the proposal.&nbsp; You can already write:<br class="">
&gt;&gt;<br class="">
&gt;&gt;&nbsp; &nbsp; &nbsp; x.get(“foo”).get(“bar”)<br class="">
&gt;&gt;<br class="">
&gt;&gt; having to write:<br class="">
&gt;&gt;<br class="">
&gt;&gt;&nbsp; &nbsp; &nbsp; x.dynamic.foo.dynamic.bar<br class="">
&gt;&gt;<br class="">
&gt;&gt; has no point.<br class="">
&gt;<br class="">
&gt; This example shows what many on this list don't believe: that any Swift method or member access can fail. If the return value of this "get" method is an IUO, or not an Optional at all, and doesn't throw, then the expression would have to fail hard if "foo" didn't resolve to something meaningful.<br class="">
&gt;<br class="">
&gt; The most common argument against this proposal is that someone could make an API using Dynamic Member Lookup that could fail even though it is not apparent to the caller. But, as we see in the example, this is just as possible today.<br class="">
<br class="">
</span>Correct.&nbsp; The argument also fails to recognize that (when bridging to a dynamic language):<br class="">
<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; x+y<br class="">
<br class="">
Is a completely dynamic method call which can fail (or return IUO), as is:<br class="">
<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; x[i]<br class="">
<br class="">
And that this is true with no changes to Swift.&nbsp; The claim that such a thing is counter to the design of Swift is completely perplexing to me.<br class=""></blockquote><div class=""><br class=""></div><div class="">I think the argument basically is "let's not add another footgun" (because the design of Swift , for example regarding null handling, is to have less footguns than other languages). The fact that there are footguns in swift isn't an argument for adding new ones.<br class=""></div><div class=""><br class=""></div><div class="">&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="">
-Chris<span class=""><br class="">
<div class="m_7572707751694735520HOEnZb"><div class="m_7572707751694735520h5"><br class="">
______________________________<wbr class="">_________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailma<wbr class="">n/listinfo/swift-evolution</a><br class="">
</div></div></span></blockquote></div><br class=""></div></div>
<br class="">______________________________<wbr 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" rel="noreferrer" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-<wbr class="">evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div>
_______________________________________________<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></blockquote></div><br class=""></body></html>