<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="">I relent. It would be more clear, as with closures, if we are forced to use _, when we don’t use $0.<div class=""><br class=""></div><div class="">To reiterate, external names without internal names do currently compile, and probably compile for this use case:</div><div 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="">protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Protocol {</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> doThing(with nameNotEnforced: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures" class="">)</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><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><span style="font-variant-ligatures: no-common-ligatures" class=""> Satisfier: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> {</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> doThing(with </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {}</span></div><div class=""><span style="font-family: Menlo; font-size: 14px;" class="">}</span></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">That’s different than what doesn’t yet compile, but ought to, to account for nondescript parameters.</div><div 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="">protocol</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Protocol {</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> printGoat(</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">@autoclosure</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">while</span><span style="font-variant-ligatures: no-common-ligatures" class=""> () -&gt; Bool)</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">}</span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo; min-height: 16px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""></span><br class=""></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">struct</span><span style="font-variant-ligatures: no-common-ligatures" class=""> Implementer: </span><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Protocol</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="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> printGoat(</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">@autoclosure</span><span style="font-variant-ligatures: no-common-ligatures" class=""> </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">while</span><span style="font-variant-ligatures: no-common-ligatures" class=""> () -&gt; Bool) {</span></div><div style="margin: 0px; line-height: normal; color: rgb(0, 132, 0);" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">// $0 must be used in this function</span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &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=""> $0() {</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">print</span><span style="font-variant-ligatures: no-common-ligatures" class="">(</span><span style="font-variant-ligatures: no-common-ligatures; color: #d12f1b" class="">"Goat"</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></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=""><br class=""></span></div><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #4f8187" class="">Implementer</span>().printGoat(<span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">while</span>: swimmingInMoat)</span></div></div><div class=""><br class=""><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Feb 8, 2016, at 9:08 PM, <a href="mailto:davesweeris@mac.com" class="">davesweeris@mac.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="">If we decide to allow external names without an internal name, I’m strongly in favor of the “<font face="Menlo" class=""><span class="" style="color: rgb(187, 44, 162);">func</span>&nbsp;doThing(with&nbsp;_:&nbsp;<span class="" style="color: rgb(112, 61, 170);">Int</span>) {}</font>“ syntax. It makes it crystal clear that we’re purposefully not assigning an internal name to that argument.<br class=""><div class=""><br class=""><div class=""><div class="">
- Dave Sweeris

</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 8, 2016, at 16:46, 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="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="" style="font-family: Helvetica; font-size: 12px;">Sorry, I forgot about this one:</span></span></div><div class="" style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="" style="font-family: Helvetica; font-size: 12px;"><br class=""></span></span></div><div class="" style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="" style="font-family: Helvetica; font-size: 12px;">5. An external, but not internal parameter name is needed. I don’t think a colon is useful in these cases.</span></span></div></div><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class=""><div class="" style="margin: 0px; line-height: normal;"><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div class="" style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;"><span class="" style="font-variant-ligatures: no-common-ligatures;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span>&nbsp;doThing(with <span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Int</span>) {}</span></div><div class="" style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;"><span class="" style="font-variant-ligatures: no-common-ligatures;"><br class=""></span></div><div class="" style="margin: 0px; line-height: normal;">It also could satisfy a protocol requirement, without having to resort to this kind of underscore usage, which should become illegal:</div><div class="" style="font-family: Menlo; font-size: 14px; margin: 0px; line-height: normal;"><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(187, 44, 162);">func</span>&nbsp;doThing(with&nbsp;_:&nbsp;<span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(112, 61, 170);">Int</span>) {}</div></div></div></div></div></div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 8, 2016, at 5:32 PM, Jessy Catterwaul &lt;<a href="mailto:mr.jessy@gmail.com" class="">mr.jessy@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">How often do you find yourself wanting an internal parameter name, but not an external (case 4)? I think it’s very rare.<div class=""><br class=""></div><div class="">I doubt that the compiler’s AI will be able to deal with case 2.b, automatically, any time soon. That is okay with me, as long as we can manually type direct objects that would not be clear with only a preposition.&nbsp;</div><div class=""><br class=""></div><div class="">I think these represent the options for parameter names in order of prevalence. Case 3 has obviously never been available in Swift, but can be emulated with generic-sounding internal parameter names. If those types of names were not necessary, I believe all of these “opting” problems would go away. Is that incorrect?&nbsp;</div><div class=""><br class=""></div><div class="">1. Internal is the same as external</div><div 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="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> function(int: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {}</span></div></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">2. External and internal names are different&nbsp;</span></span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><div style="margin: 0px; line-height: normal;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">a. func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> doThing(with int: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</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; color: #bb2ca2" class="">b. func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> doThing(withGiraffe giraffe: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Any</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {}</span></div></span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><br class=""></span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="font-family: Helvetica; font-size: 12px;" class="">3. No parameter name is needed internally or externally</span></span></div><div style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;" class=""><span style="font-variant-ligatures: no-common-ligatures" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">func</span> function(Int)</span></div><div class=""><br class=""></div><div class="">4. Underscore for external, name for internal</div><div 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="">func</span><span style="font-variant-ligatures: no-common-ligatures" class=""> function(</span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> int: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">Int</span><span style="font-variant-ligatures: no-common-ligatures" class="">) {}</span></div></div></div></div></blockquote></div><br class=""></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=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""></div></div></body></html>