<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></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 Mar 3, 2016, at 2:14 PM, Jacob Bandes-Storch &lt;<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Will this allow me to write "let myDispatchSync = dispatch_sync as! @noescape () -&gt; Void" &nbsp;? :-D</div></div></blockquote><div><br class=""></div>Yes, &nbsp;but you need to spell it like this:</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>let&nbsp;myDispatchSync = dispatch_sync&nbsp;as! ((dispatch_queue_t,&nbsp;@noescape&nbsp;@convention(block) () -&gt; ()) -&gt;&nbsp;Void)<br class=""><br class="">The right answer here is to add @noescape to the imported symbol of course.</div><div><br class=""></div><div>-Chris<br class=""><div><br class=""></div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">Sounds good to me, the old syntax is not necessary anymore.</div><div class="gmail_extra"><br clear="all" class=""><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class="">Jacob<br class=""></div></div></div></div>
<br class=""><div class="gmail_quote">On Thu, Mar 3, 2016 at 2:01 PM, Chris Lattner via swift-evolution <span dir="ltr" class="">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>&gt;</span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Chris Eidhof noticed an emergent result of removing our currying syntax: it broke some useful code using @noescape, because we only allowed it on parameter declarations, not on general things-of-function-type.&nbsp; This meant that manually curried code like this:<br class="">
<br class="">
func curriedFlatMap&lt;A, B&gt;(x: [A]) -&gt; (@noescape A -&gt; [B]) -&gt; [B] {<br class="">
&nbsp; &nbsp; return { f in<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; x.flatMap(f)<br class="">
&nbsp; &nbsp; }<br class="">
}<br class="">
<br class="">
Was rejected.&nbsp; Fixing this was straight-forward (<a href="https://github.com/apple/swift/commit/c3c6beac72bc0368030f06d52c46b6444fc48dbd" rel="noreferrer" target="_blank" class="">https://github.com/apple/swift/commit/c3c6beac72bc0368030f06d52c46b6444fc48dbd</a>), but required @noescape being allowed on arbitrary function types.&nbsp; Now that we have that, these two declarations are equivalent:<br class="">
<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; func f(@noescape fn : () -&gt; ()) {}<br class="">
&nbsp; &nbsp; &nbsp; &nbsp; func f(fn : @noescape () -&gt; ()) {}<br class="">
<br class="">
I propose that we remove the former syntax, migrating code to the later form.&nbsp; This leads to better consistency between our declarations and types, and follows the precedent of inout.&nbsp; @autoclosure should also probably move as well.<br class="">
<br class="">
Thoughts?<br class="">
<br class="">
-Chris<br class="">
_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" 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=""></div></div>
</div></blockquote></div><br class=""></body></html>