<div dir="ltr">I don't think either are that nice, we could do a ruby thing and use "do". The do expresses that we are passing in a block :) and the arguments are on the outside of the closure which matches iit elsewhere:<div><br></div><div>heyThere() do |hi, there|</div><div>{</div><div><br></div><div>}</div><div><br></div><div>we could allow anon functions like so:</div><div><br></div><div>heyThere((hi, there){</div><div>})</div><div><br></div><div>But then its inconsistent, so I don't mind what swift does now :) as its consistent whether its a closure block or a argument we are passing in.</div><div><br></div><div>Regarding the "=>" vs "in" debate, they are both obtuse to me. In some-ways "in" is better as it reads to me as "the arguments in this closure" so I would much prefer "in". I know this is subjective but that's just my two cents ;)</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 23, 2015 at 9:42 AM, Tino Heth via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><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><br><blockquote type="cite"><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant: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">love trailing closures</span></div></blockquote></div>I wouldn't go that far and just say "})" looks ugly — but that has the same implications ;-)<div>With parameters, trailing closures loose a lot of their appeal, and an alternative syntax ("func(x: Int) {" instead of "{ x: Int in}" isn't that bad for trailing closure either.</div><div><br></div><div>The only obvious downside is the "$0" shortcut would be confusing with "func() {" (but not so much with "func {"…).</div><div>Speaking of "$0", you could argue why it is allowed in closures and not in methods… but I'm in some discord with $0 anyways:</div><div>It is really nice for small constructs, but drawing the line when to discourage their use is tough (at least to tough for the compiler to enforce a rule).</div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=xV0JY-2FdZMnUMvSFtZnLiBPRTDDOSQf3-2FpH33HYOlBxGQu-2FZIsQFIEVW9DVYNOoIXS-2FOwlrLbEpcBYL6KngjFX4MwjiBSVvmfAmtM4egzKkYlZ-2B-2FUjZrhXzTMlwMHIKu4AygxipHV7laXKAUxwlf4cd1l2pIsFG9pZ48aif474oqPKSVG7o4OksuIADzFw4uUrQ31U6HNGbM-2F41gBNswLnLNF7SqzZblWmJRf-2BerEchg-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>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">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>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><span style="font-size:16px;line-height:19.2px"></span><span style="font-size:12.8px"> Wizard</span><br></div><div><a href="mailto:james@supmenow.com" target="_blank">james@supmenow.com</a></div><div>+44 7523 279 698</div></div></div></div></div></div>
</div>