<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 Feb 5, 2016, at 11:15 AM, Jessy Catterwaul 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=""><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="">I am fine with this proposal, except for having to name the parameter. The argument should be known as $0, within the function. Explanation and example…</div></div></div></blockquote><div><br class=""></div><div>Hi Jessy,</div><div><br class=""></div><div>I don’t understand what you’re referring to here. &nbsp;The proposal is about removing a feature, not changing existing functionality or adding new things. &nbsp;If you’d like to propose a language change, please do so on a new thread.</div><div><br class=""></div><div>-Chris</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=""><br class=""></div>My single use case of where this feature <i class="">might have</i>&nbsp;worked, actually does not. See the double parentheses:<div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; line-height: normal;" class=""><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">protocol</span> Protocol {</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typealias</span> Arguments</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> ƒ1(parameters: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span>) -&gt; <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> ƒ2(parameters: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span>)</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">}</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><br class=""></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><br class=""></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span> Struct1: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Protocol</span> {</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typealias</span> Arguments = (goodName: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span>, otherGoodName: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span>)</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> ƒ1(parameters: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span>) -&gt; <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span> {</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp; &nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span> (goodName: <span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">""</span>, otherGoodName: <span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">""</span>)</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp;&nbsp; }</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> ƒ2(parameters: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span>) {}</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">}</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><br class=""></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> struct1 = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Struct1</span>()</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><br class=""></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class="">// Too many parentheses are needed, but whatever.</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class="">// Not a big deal.</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> struct1Arguments = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">struct1</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">ƒ1</span>((goodName: <span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">""</span>, otherGoodName: <span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">""</span>))</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><br class=""></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; color: rgb(79, 129, 135);" class="">struct1<span style="" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">ƒ2</span><span style="" class="">(</span>struct1Arguments<span style="" class="">)</span></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><br class=""></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><span style="font-family: Helvetica; font-size: 12px;" class=""><br class=""></span></div><div style="margin: 0px; line-height: normal; min-height: 16px;" class="">Typealiases fall apart when I need a single parameter:</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><br class=""></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span> Struct2: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Protocol</span> {</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="" class="">&nbsp;&nbsp; </span>// Should be (goodName: String) but named 1-tuples don't work.</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typealias</span> Arguments = <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class="">&nbsp; &nbsp;<br class="webkit-block-placeholder"></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> ƒ1(parameters: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span>) -&gt; <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span> {<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span> <span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">""</span>}</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> ƒ2(parameters: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span>) {}</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class="">}</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><br class=""></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> struct2 = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Struct2</span>()</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><br class=""></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class="">// No extra parentheses are needed but I don't know what the argument is.</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class="">// This is a big deal.</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> struct2Arguments = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">struct2</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">ƒ1</span>(<span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">""</span>)</div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; min-height: 16px;" class=""><br class=""></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; color: rgb(79, 129, 135);" class="">struct2<span style="" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">ƒ2</span><span style="" class="">(</span>struct2Arguments<span style="" class="">)</span></div></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; color: rgb(79, 129, 135);" class=""><span style="" class=""><br class=""></span></div><div style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal; color: rgb(79, 129, 135);" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class="">We need to be able to name the element of a single-item tuple, and we need to stop enforcing&nbsp;internal parameter names:</div><div style="margin: 0px; line-height: normal;" class=""><br class=""></div><div style="margin: 0px; line-height: normal;" class=""><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">protocol</span> Protocol {</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typealias</span> Arguments</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> ƒ1(Arguments) -&gt; <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> ƒ2(Arguments)</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span> Struct: <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Protocol</span> {</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">typealias</span> Arguments = (goodName: <span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">String</span>)</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> ƒ1(Arguments) -&gt; <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Arguments</span> {</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">&nbsp; &nbsp; &nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">return</span> (goodName: $0.goodName)</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">&nbsp;&nbsp; }</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">&nbsp;&nbsp; <span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> ƒ2(Arguments) {}</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class="">}</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;" class=""><br class=""></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> `struct` = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Struct</span>()</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span> structArguments = <span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">`struct`</span>.<span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">ƒ1</span>((goodName: <span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">""</span>))</div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; color: rgb(79, 129, 135);" class="">`struct`<span style="" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #31595d" class="">ƒ2</span><span style="" class="">(</span>structArguments<span style="" class="">)</span></div></div></div></div></div></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>