Everyone, <div><br></div><div>The sticking point here is that xcode generates the first syntax automatically. </div><div><br></div><div>Simply filing a radar about this would be useless, so I believe the original proposal is meant to sort-of &quot;light a fire&quot; under the Xcode team; by introducing a new language feature they would be forced to support it. </div><div><br></div><div>Personally, I think it should just be fixed in Xcode as well, but it&#39;s not that simple. <br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jan 5, 2016, 8:35 AM Jérôme Duquennoy &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</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"><div>Hi everybody,</div><div><br></div>I do agree with Kevin : trailing closures is only a possibility offered by the language, you are not forced to use it.<div>In the case you show, I agree that the second syntax is more readable than the first one. Good news is : it does compile :-).</div><div><br></div><div>I think adding a specific keyword or annotation to locally forbid trailing closure would add complexity to the language for no real advantage.</div><div><br></div><div>-1 for me thus.</div><div><br></div><div>Jerome</div></div><div style="word-wrap:break-word"><div><br><div><br><div><br><div><blockquote type="cite"><div>On 04 Jan 2016, at 19:52, Kevin Ballard via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:</div><br><div>




<div><div>What&#39;s the point of this? What problem does it solve? If you don&#39;t want a trailing closure, just don&#39;t use trailing closure syntax. I don&#39;t see what benefit there is in explicitly annotating the function to disallow trailing closure syntax with it; just because you don&#39;t want to use trailing closure syntax doesn&#39;t mean nobody should be able to use it. And other people using it shouldn&#39;t affect you.<br></div>
<div> </div>
<div>-Kevin Ballard<br></div>
<div> </div>
<div>On Mon, Jan 4, 2016, at 04:45 AM, QQ Mail via swift-evolution wrote:<br></div>
<blockquote type="cite"><div>Hi, All: <br></div>
<div><span style="white-space:pre-wrap"></span>trailing closure is good for most cases, but sometimes it is also make code unclear, for example: <br></div>
<div> </div>
<div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo"><span style="color:rgb(112,61,170)">UIView</span>.<span style="color:rgb(61,29,129)">animateWithDuration</span>(<span style="color:rgb(39,42,216)">0.3</span>, animations: { () -&gt; <span style="color:rgb(112,61,170)">Void</span> <span style="color:rgb(187,44,162)">in</span><br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span></span>// animation code here<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo">    }) { (Bool) -&gt; <span style="color:rgb(112,61,170)">Void</span> <span style="color:rgb(187,44,162)">in</span><br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span></span>// completion code here<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo">}<br></div>
</div>
<div> </div>
<div>the label been removed and the code also not aligned well. <br></div>
<div>I would like to write like this: <br></div>
<div> </div>
<div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(61,29,129)"><span style="color:rgb(112,61,170)">UIView</span><span>.</span>animateWithDuration<span>(</span><span style="color:rgb(39,42,216)">0.3</span><span>,</span><br></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><br></div><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo">    animations: { () -&gt; <span style="color:rgb(112,61,170)">Void</span> <span style="color:rgb(187,44,162)">in</span><br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span></span>// animation code here<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo">    },<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo">    completion: { Bool -&gt; <span style="color:rgb(112,61,170)">Void</span> <span style="color:rgb(187,44,162)">in</span><br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,132,0)"><span></span>// completion code here<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo">    }<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo">)<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"> </div>
</div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">It is possible, just every time you have to write it manually. It’s a little wast.<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">So I have a thought, since we already know this function is not well suit for trailing <br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px">closure, can we add a attribute to disable it, for example: <br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"> </div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;font-size:11px;line-height:normal;font-family:Menlo;min-height:13px"><div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal;color:rgb(187,44,162)">extension<span></span><span style="color:rgb(112,61,170)">UIView</span><span> {</span><br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal;min-height:13px"> </div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal"><span style="color:rgb(255,40,7)">@disable_trailing_closure</span><br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal"><span style="color:rgb(187,44,162)">    public</span> <span style="color:rgb(187,44,162)">static</span> <span style="color:rgb(187,44,162)">func</span> animateWithDuration(duration:<span style="color:rgb(112,61,170)">NSTimeInterval</span>, animations:()-&gt;<span style="color:rgb(112,61,170)">Void</span>, completion:()-&gt;<span style="color:rgb(112,61,170)">Void</span>) {<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal;color:rgb(0,132,0)"><span></span>// implementations ...<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal">    }<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal">}<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal"> </div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal">I also found another one have issue for this too. link: <a href="http://www.natashatherobot.com/swift-trailing-closure-syntax/" target="_blank">http://www.natashatherobot.com/swift-trailing-closure-syntax/</a><br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal">what do you think?<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal"> </div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal">Best Regards<br></div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal"> </div>
<div style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0px;line-height:normal">ChenYungui<br></div>
</div>
<div><img style="min-height:1px!important;width:1px!important;border-top-width:0px!important;border-right-width:0px!important;border-bottom-width:0px!important;border-left-width:0px!important;margin-top:0px!important;margin-bottom:0px!important;margin-right:0px!important;margin-left:0px!important;padding-top:0px!important;padding-bottom:0px!important;padding-right:0px!important;padding-left:0px!important" border="0" height="1" width="1" alt="" src="https://www.fastmailusercontent.com/proxy/412c5a6d09663f8932538ffb032f477bf08ae0aeb363d1444052f4eb53353121/8647470737a3f2f25723030323431303e23647e23756e64676279646e2e65647f27766f2f60756e6f35707e6d3148765176786c673171614a7d2236454230345272776e485235453667555f49584f68403577795e6948627d22364646656476565363556778737b6a6b65527857587f6d656249526a7f61336055725871644e6c4372497669557935387d2232435036573350587741733555485979727572484d223243715d22324d2232413c4b696a5b4863317e6f4b62584b694a6a49375d4a6a724973754172707145785434654d223246665466663a6e4a5a536b64777a43313759727a794372376a4266364234666830325e63664258716642583c6a4f49634f4178554e4a736a724378635935477d23344d23344/open"><br></div>
<div><u>_______________________________________________</u><br></div>
<div>swift-evolution mailing list<br></div>
<div><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br></div>
<div><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div>
</blockquote><div> </div>

<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=ZfNDJ3c1KY40DpRPxaBpmw0PAd1TZW0h3lqFWlwcZNWjLV96dbtcrCsiPWnUeEjw6PthedwrtaabR9IDRv3eKTDAk0yEbNP9XkdRcWEJV2X-2BcrobzB7Ow0Mp0Bt7Wgx01iJOjhu1S5PWdIGdHrxb4vqEWdr8e-2BKRh3-2FgQfQqM-2BFFFR-2FgQTTJ6rDfnx5XXfnDur5GVMZsOYoEAbn7kECGtRlLJpUKUOHjlBLkIO4QEdY-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
</div>


_______________________________________________<br>swift-evolution mailing list<br><a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br></div></blockquote></div><br></div></div></div></div><div style="word-wrap:break-word"><div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=8CZIdLciSFC-2BO5jF-2FiP8qN7dBFsgCUZ50wdTsolcRPfR0qrbhV6R2eSvVtuT-2B1EKLBM1xyaFQpz22pPpOYr1oXH49ffoJd0981FEu-2FATQoVcf5wnamjdEOc-2Fps-2BoHLPU2Gm2WrIe-2FLwzShR77SyDGvXU8wI6gpfh4wZL-2FQ6d-2BOaWSR3-2Fa3fgfuX7X0hodStDnkuTE2EuP-2ByJA-2BScYkP5dwYXCZ3H-2F9Th1UK4-2B1aiWd4-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0!important;margin-top:0!important;margin-bottom:0!important;margin-right:0!important;margin-left:0!important;padding-top:0!important;padding-bottom:0!important;padding-right:0!important;padding-left:0!important">
</div>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div></div>