<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=""><div class="">I agree with Xiaodi about the syntax. We should not use ‘_’ here for the same reason that we <i class="">do</i>&nbsp;use it for label-less parameters: it makes every argument always marked by at least two characters. That makes it easier to read and harder to typo.</div><div class=""><br class=""></div><div class="">I <i class="">do</i>&nbsp;see that there’s a problem between ‘foo()’ (a reference to a function with no arguments) and ‘foo()’ (the result of calling a function with no arguments).</div><div class=""><br class=""></div><div class="">I’m personally not so inclined to worry about the “reference to a function” syntax; I’ve ultimately fallen into the camp that prefers a wrapper closure in most cases. The selector case is a little different. <i class="">If</i>&nbsp;we ban general expressions there, then I think there’s no problem with it being mistaken for an actual call, because <i class="">nothing</i>&nbsp;in #selector would act like a call anyway. If we don’t, it’d still be unambiguous…but I agree that it could be confusing.</div><div class=""><br class=""></div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On May 5, 2016, at 09:34, Xiaodi Wu 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="">I disagree. Not having a parameter label implies presence of a parameter. It is not natural at all to use the same symbol to denote absence of a parameter. `foo(_)` is a single typo away from `foo(_:)`.<br class=""><br class="">IMO, after arbitrary expressions are removed from #selector, it is straightforwardly a bug that `foo()` cannot be used to denote a function with no parameters.<br class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, May 5, 2016 at 10:59 Alex Hoppen via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Say you have the function `foo() -&gt; Int`. Then `foo()` calls `foo` and returns its return value of type `Int` – not a reference to the function of type `Void -&gt; Int`.<br class="">
<br class="">
As to `_`: Like I stated in the proposal the underscore is already used in functions to state that there is no parameter name. So I think it’s a natural extension to also use it for saying that there are no arguments at all.<br class="">
<br class="">
– Alex<br class="">
<br class="">
&gt; On 05 May 2016, at 17:21, David Sweeris &lt;<a href="mailto:davesweeris@mac.com" target="_blank" class="">davesweeris@mac.com</a>&gt; wrote:<br class="">
&gt;<br class="">
&gt; What’s wrong with `foo()` again? To me, a `_` in the parameter list means that something is there, but the label doesn’t matter.<br class="">
&gt;<br class="">
&gt; - Dave Sweeris<br 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/mailman/listinfo/swift-evolution</a><br class="">
</blockquote></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>