<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="">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><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="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></div></div></body></html>