<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="">Hello all,<div class=""><br class=""></div><div class="">I was wondering if this topic had evolved in anyway since its original introduction.</div><div class=""><br class=""></div><div class="">@noescape(once) would still be a useful addition to the language!</div><div class=""><br class=""></div><div class="">Gwendal Roué</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Le 3 févr. 2016 à 22:21, Félix Cloutier 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=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">I updated the proposal to address some concerns. It can be found at:&nbsp;<a href="https://github.com/zneak/swift-evolution/blob/master/proposals/00xx-noescape-once.md" class="">https://github.com/zneak/swift-evolution/blob/master/proposals/00xx-noescape-once.md</a><div class=""><br class=""></div><div class="">Things that changed:</div><div class=""><br class=""></div><div class=""><ul class="MailOutline"><li class="">It now says that the closure must be called on code paths where the function throws;</li><li class="">you can have multiple @noescape(once) parameters but they can't make assumptions from one another.</li></ul><div class=""><br class=""></div><div class="">I'm not 100% convinced that forcing a call on code paths that throw is always desirable. I've changed it because Chris's support probably means that the feature has better chances of making it, but I'm not convinced yet. If throwing allows me to return without calling the closure, I can write this:</div><div class=""><br class=""></div><div class=""><div class="">do {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>let foo: Int</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>try withLock(someLock, timeout: 0.5) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">                </span>foo = sharedThing.foo</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>}</div><div class="">} catch {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>print("couldn't acquire lock fast enough")</div><div class="">}</div></div><div class=""><br class=""></div><div class="">which would be kind of messy if instead, the closure needed a parameter to tell whether the lock was acquired or not when it runs.</div><div class=""><div class="">
<br class="Apple-interchange-newline"><span style="font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-position: normal; font-variant-caps: normal; font-variant-numeric: normal; font-variant-alternates: normal; font-variant-east-asian: 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; float: none; display: inline !important;" class="">Félix</span>
</div>
<br class=""></div></div></div>_______________________________________________<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></blockquote></div><br class=""></div></body></html>