<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="">Is @autoclosure type information? To me, it feels more like a parameter attribute, so I'm happy to have it on the parameter name side.<br class=""><div class="">
<br class="Apple-interchange-newline"><span style="color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; display: inline !important; float: none;" class="">Félix</span>
</div>

<br class=""><div><blockquote type="cite" class=""><div class="">Le 3 mars 2016 à 17:01:41, Chris Lattner via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; a écrit :</div><br class="Apple-interchange-newline"><div class=""><div class="">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;&nbsp;return { f in<br class=""> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x.flatMap(f)<br class=""> &nbsp;&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" 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=""><span class="Apple-tab-span" style="white-space:pre">        </span>func f(@noescape fn : () -&gt; ()) {}<br class=""><span class="Apple-tab-span" style="white-space:pre">        </span>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="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></div></blockquote></div><br class=""></body></html>