<div dir="ltr"><span style="font-size:13px"> * What is your evaluation of the proposal?</span><div style="font-size:13px">+1</div><div style="font-size:13px"><br></div><div style="font-size:13px">I agree with others that there are opportunities to generalise this proposal.</div><div style="font-size:13px"><br></div><div style="font-size:13px">It would be pretty magical if it could be applied to escaping closures, less magical if that's just adding a runtime assertion. It would also be much more flexible if it could be used for multiple exclusive `if-else` closures. However, I don't think this magic or flexibility is necessary to make this proposal useful.</div><div style="font-size:13px"><br></div><div style="font-size:13px">This proposal does add things you wouldn't be able to do otherwise, and it's made clear to the user by the explicit pairing of @noescape and once.</div><div style="font-size:13px"><br></div><div style="font-size:13px">--</div><div style="font-size:13px"><br></div><div style="font-size:13px">It would be okay if (once) became @once, however I think this is only useful if it was allowed on escaping closures. Adding compile-time assurances to this is possible, but much more complicated (requiring strict checks on storage, calling, passing).</div><div style="font-size:13px"><br></div><div style="font-size:13px">I'm not sure if the added complexity of an escaping once is worth considering until Swift concurrency (Swift 4?). I don't think the guarantees would have any advantage for the compiler, and I don't think the *currently* advantage to the user would be worth much more than a comment.</div><div style="font-size:13px"><br></div><div style="font-size:13px"><span><div> * Is the problem being addressed significant enough to warrant a change to Swift?</div></span><div>Yes</div><span> * Does this proposal fit well with the feel and direction of Swift?</span><div>Yes<span><br> * If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</span></div><div>no<span><br> * How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br></span></div></div><div style="font-size:13px">I have followed the thread, read the proposal, participated in the the discussion.</div><div style="font-size:13px"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 7, 2016 at 12:17 PM, Andrew Bennett <span dir="ltr"><<a href="mailto:cacoyi@gmail.com" target="_blank">cacoyi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div style="font-size:13px">Hi Dave,</div><div style="font-size:13px"><br></div><div style="font-size:13px">Sorry, Dave, sending a second time as I forgot to Reply-All.</div><span class=""><div style="font-size:13px"><br></div><span style="font-size:13px">I agree, this proposal doesn't allow multiple closures where only one of them should be run, and it should only be run once. I personally don't think lacking that functionality is worth blocking this proposal for, another proposal can be built on top of this if it is desired.</span><div style="font-size:13px"><br></div><div style="font-size:13px"><div>These cases can also be handled by a more meaningful <font face="monospace, monospace">if</font>/<font face="monospace, monospace">switch</font> statement, using <font face="monospace, monospace">@noescape(once)</font>, for example:</div><div><font face="monospace, monospace"> let x: Int<br></font><div><font face="monospace, monospace"><font size="2"><span style="background-color:rgba(255,255,255,0)"> functionThatCallsAClosure(someTest()) { </span></font><font size="2"><span style="background-color:rgba(255,255,255,0)">x = $</span></font><span style="background-color:rgba(255,255,255,0)">0 ?</span><span style="background-color:rgba(255,255,255,0)"> 1 :</span><span style="background-color:rgba(255,255,255,0)"> 2 }</span></font></div></div></div></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, May 7, 2016 at 6:24 AM, Dave Abrahams 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"><span><br>
on Tue May 03 2016, Chris Lattner <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
<br>
> Hello Swift community,<br>
><br>
> The review of "SE-0073: Marking closures as executing exactly once"<br>
> begins now and runs through May 9. The proposal is available here:<br>
><br>
> <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0073-noescape-once.md" rel="noreferrer" target="_blank">https://github.com/apple/swift-evolution/blob/master/proposals/0073-noescape-once.md</a><br>
><br>
> Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at<br>
><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>
> or, if you would like to keep your feedback private, directly to the review manager.<br>
><br>
> What goes into a review?<br>
><br>
> The goal of the review process is to improve the proposal under review<br>
> through constructive criticism and contribute to the direction of<br>
> Swift. When writing your review, here are some questions you might<br>
> want to answer in your review:<br>
><br>
> * What is your evaluation of the proposal?<br>
<br>
</span>I think it's of questionable importance and doesn't generalize well.<br>
For example, you can't use this to construct something like<br>
<br>
var x: Int<br>
functionThatActsLikeIf( someTest(), then: { x = 1 }, else: { x = 2} )<br>
<br>
If you need to initialize something in an outer scope with something<br>
computed by a closure, it's much better to arrange something like this:<br>
<br>
var x = functionThatActsLikeIf( someTest(), then: { 1 }, else: { 2 } )<br>
<span><font color="#888888"><br>
--<br>
Dave<br>
</font></span><div><div><br>
_______________________________________________<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>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>