<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 20 Mar 2017, at 14:24, Rien via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Another solution to the original problem would be to allow the parameter name of the closure outside the functions parenthesis:<br class=""><br class="">func test(a: Int, onError: ()->Void) {…}<br class=""><br class="">could be called like this:<br class=""><br class="">test(5) onError: { myErrorHandler() }</div></div></blockquote><br class=""></div><div>When you get onto that kind of syntax the obvious question is, what's wrong with:</div><div><br class=""></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>test(5, onError: { myErrorHandler() })</font></div><div><br class=""></div><div>To me there's no real difference, in fact all that's changed now is that a round bracket is at the end; while being within the parenthesis is a little noisier, it's also clearer what's going on. Consider, if the body of the closure were very long:</div><div><br class=""></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>test(5, onError: {</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>// Lots</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>// and</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>// lots</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>// of</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">                </span>// code</font></div><div><font face="Monaco" class=""><span class="Apple-tab-span" style="white-space:pre">        </span>})</font></div><div><br class=""></div><div>Here the closing round bracket reminds me that this is the end of a closure being passed to a function, rather than some other code block and, if properly indented, it should be easy to jump to whatever that function is.</div><div><br class=""></div><div>It could just be my personal preference; I'm generally uncomfortable with the use of trailing closures except for language-like constructs such as .forEach, and I've never had any problem using closures within the function's parenthesis, but it just seems like there's a point at which we're bolting so much onto trailing closures, that you really do have to ask what's so wrong with just passing the closure normally?</div></body></html>