<div dir="ltr">-1 to this proposal.<div><br></div><div>While it is true that adding the argument labels helps you &quot;read&quot; it better, you end up with an inverted binary operator.  I&#39;ll call it a sandwich.</div><div><br></div><div>Argument labels should be used to name an argument so the fact that there is no argument provided means that this is not a good use case.</div><div><br></div><div>I prefer the work around where you accept a void argument.</div><div><br></div><div>func something(_ n: Int, strange: Void) { ... }</div><div><br></div><div>Then we people look at the definition they can see that it expects a void!</div><div><br></div><div>They can call it like this</div><div><br></div><div>something(8, strange: ())</div><div><br></div><div>in conclusion, I do not support the original pitch.  Argument labels should be used for arguments.<br><br><div class="gmail_quote"><div dir="ltr">On Wed, Feb 22, 2017 at 9:22 AM Haravikk &lt;<a href="mailto:swift-evolution@haravikk.me">swift-evolution@haravikk.me</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="gmail_msg"><br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On 22 Feb 2017, at 13:19, Derrick Ho &lt;<a href="mailto:wh1pch81n@gmail.com" class="gmail_msg" target="_blank">wh1pch81n@gmail.com</a>&gt; wrote:</div><br class="m_8867729018209136553Apple-interchange-newline gmail_msg"><div class="gmail_msg">I&#39;ve read the pitch, but it isn&#39;t clear what the ask is or what benefit it would give.</div></blockquote><br class="gmail_msg"></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">The purpose of the feature is to enable selection of identically named methods with similar signatures. This came up in the protocol-oriented integers debate on the ability to have arithmetic methods with and without overflow. Like so:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>protocol IntegerArithmetic {</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">                </span>func adding(_ other:Self) -&gt; Self</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">                </span>func adding(_ other:Self, reportingOverflow) -&gt; (Self, Bool)</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>}</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><br class="gmail_msg"></font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>var a = 2, b = 3</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>let resultWithoutOverflow = a.adding(b)</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>let resultWithOverflow = a.adding(b, reportingOverflow)</font></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Here we have two different methods, one reporting overflow and one without, using the label to enable selection, rather than having to have an addingWithOverflow() method or similar.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Currently the alternative is to do something like:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>enum ReportingOverflow { case .reportingOverflow }</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>protocol IntegerArithmetic {</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">                </span>func adding(_ other:Self) -&gt; Self</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">                </span>func adding(_ other:Self, _) -&gt; (Self, Bool)</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>}</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><br class="gmail_msg"></font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>var a = 2, b = 3</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>let resultWithoutOverflow = a.adding(b)</font></div><div class="gmail_msg"><font face="Monaco" class="gmail_msg"><span class="m_8867729018209136553Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>let resultWithOverflow = a.adding(b, .reportingOverflow)</font></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Basically the ability to use the label for method selection is an alternative to either defining an enum as above, or having to use a different method name.</div></div></blockquote></div></div></div>