The only difference between your proposed spelling and not using trailing closures at all is the placement of the closing parenthesis, which is not at all a clear enough win sufficient to justify having two spellings for the same thing.<br><br>I'm of the same opinion that was expressed by Erica Sadun and Jordan Rose last summer, that where a function takes more than one closure argument--defaulted to nil or no--it's arguable that we ought to prohibit trailing closures altogether for the sake of clarity.<br><div class="gmail_quote"><div dir="ltr">On Wed, Jan 4, 2017 at 21:48 Saagar Jha via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> 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">Check out <a href="https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160606/020470.html" class="gmail_msg" target="_blank">this thread</a>–it’s very similar to what you proposed, but it didn’t go anywhere. FWIW +1 to this as well as the ability to use multiple trailing closures like so:<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">animate(identifier: “”, duration: 0, update: {</div><div class="gmail_msg"><span class="m_-8216694715184908862Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>// update</div><div class="gmail_msg">}, completion: {</div><div class="gmail_msg"><span class="m_-8216694715184908862Apple-tab-span gmail_msg" style="white-space:pre-wrap">        </span>// completion</div><div class="gmail_msg">}</div><div class="gmail_msg"></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">
<br class="m_-8216694715184908862Apple-interchange-newline gmail_msg"><span style="color:rgb(0,0,0);font-family:'SF UI Text';font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important" class="gmail_msg">Saagar Jha</span><br style="color:rgb(0,0,0);font-family:'SF UI Text';font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br style="color:rgb(0,0,0);font-family:'SF UI Text';font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg"><br style="color:rgb(0,0,0);font-family:'SF UI Text';font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" class="gmail_msg">
</div></div></div><div style="word-wrap:break-word" class="gmail_msg"><div class="gmail_msg">
<br class="gmail_msg"><div class="gmail_msg"><blockquote type="cite" class="gmail_msg"><div class="gmail_msg">On Jan 4, 2017, at 6:25 PM, Jay Abbott via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a>> wrote:</div><br class="m_-8216694715184908862Apple-interchange-newline gmail_msg"><div class="gmail_msg"><div dir="ltr" class="gmail_msg"><div class="m_-8216694715184908862markdown-here-wrapper gmail_msg"><p style="margin:0px 0px 1.2em!important" class="gmail_msg">When you have a function with a closure and then another optional default <code style="font-size:1em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="gmail_msg">= nil</code> closure at the end, like this:</p>
<pre style="font-size:1em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px" class="gmail_msg"><code class="m_-8216694715184908862language-swift m_-8216694715184908862hljs gmail_msg" style="font-size:1em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248) none repeat scroll 0% 0%">open <span class="m_-8216694715184908862hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">static</span> <span class="m_-8216694715184908862hljs-func gmail_msg"><span class="m_-8216694715184908862hljs-keyword gmail_msg" style="color:rgb(51,51,51);font-weight:bold">func</span> <span class="m_-8216694715184908862hljs-title gmail_msg" style="color:rgb(153,0,0);font-weight:bold">animate</span><span class="m_-8216694715184908862hljs-params gmail_msg">(identifier: String,
duration: Double,
update: @escaping AnimationUpdate,
completion: AnimationCompletion? = <span class="m_-8216694715184908862hljs-built_in gmail_msg" style="color:rgb(0,134,179)">nil</span>)</span> </span>{
</code></pre><p style="margin:0px 0px 1.2em!important" class="gmail_msg">You can’t use trailing closure syntax for the <code style="font-size:1em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="gmail_msg">update</code> argument when leaving the <code style="font-size:1em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline" class="gmail_msg">completion</code> argument out/default.</p><p style="margin:0px 0px 1.2em!important" class="gmail_msg">This kind of breaks one of the benefits of default arguments, which is that you can add them to existing released functions without breaking the calling code. This means you have to add a separate convenience function without the extra argument, which is annoying and inelegant. Another annoying thing is that you can easily miss this error if you happen to not use trailing closure syntax in your tests or other usage, because adding the extra default argument compiles fine for code that uses normal syntax.</p><p style="margin:0px 0px 1.2em!important" class="gmail_msg">Are there any issues/gotchas if the trailing closure syntax were to work for the last <em class="gmail_msg">specified</em> argument rather than the last <em class="gmail_msg">defined</em> argument?</p>
<div title="MDH:PGRpdiBkaXI9Imx0ciIgY2xhc3M9ImdtYWlsX21zZyI+PGRpdiBjbGFzcz0iZ21haWxfbXNnIj48
ZGl2IGNsYXNzPSJnbWFpbF9tc2ciPjwvZGl2PldoZW4geW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bmUgZm9yIGNvZGUgdGhhdCB1c2VzIG5vcm1hbCBz
eW50YXguPGJyIGNsYXNzPSJnbWFpbF9tc2ciPjxiciBjbGFzcz0iZ21haWxfbXNnIj48L2Rpdj48
ZGl2IGNsYXNzPSJnbWFpbF9tc2ciPkFyZSB0aGVyZSBhbnkgaXNzdWVzL2dvdGNoYXMgaWYgdGhl
IHRyYWlsaW5nIGNsb3N1cmUgc3ludGF4IHdlcmUgdG8gd29yayBmb3IgdGhlIGxhc3QgKnNwZWNp
ZmllZCogYXJndW1lbnQgcmF0aGVyIHRoYW4gdGhlIGxhc3QgKmRlZmluZWQqIGFyZ3VtZW50Pzxi
ciBjbGFzcz0iZ21haWxfbXNnIj48L2Rpdj48L2Rpdj4=" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0" class="gmail_msg"></div></div></div>
_______________________________________________<br class="gmail_msg">swift-evolution mailing list<br class="gmail_msg"><a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg"><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg"></div></blockquote></div><br class="gmail_msg"></div></div>_______________________________________________<br class="gmail_msg">
swift-evolution mailing list<br class="gmail_msg">
<a href="mailto:swift-evolution@swift.org" class="gmail_msg" target="_blank">swift-evolution@swift.org</a><br class="gmail_msg">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="gmail_msg">
</blockquote></div>