<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&#39;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&#39;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&#39;t be able to do otherwise, and it&#39;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&#39;m not sure if the added complexity of an escaping once is worth considering until Swift concurrency (Swift 4?). I don&#39;t think the guarantees would have any advantage for the compiler, and I don&#39;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">&lt;<a href="mailto:cacoyi@gmail.com" target="_blank">cacoyi@gmail.com</a>&gt;</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&#39;t allow multiple closures where only one of them should be run, and it should only be run once. I personally don&#39;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">&lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt;</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 &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br>
<br>
&gt; Hello Swift community,<br>
&gt;<br>
&gt; The review of &quot;SE-0073: Marking closures as executing exactly once&quot;<br>
&gt; begins now and runs through May 9. The proposal is available here:<br>
&gt;<br>
&gt;       <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>
&gt;<br>
&gt; Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at<br>
&gt;<br>
&gt;       <a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
&gt;<br>
&gt; or, if you would like to keep your feedback private, directly to the review manager.<br>
&gt;<br>
&gt; What goes into a review?<br>
&gt;<br>
&gt; The goal of the review process is to improve the proposal under review<br>
&gt; through constructive criticism and contribute to the direction of<br>
&gt; Swift. When writing your review, here are some questions you might<br>
&gt; want to answer in your review:<br>
&gt;<br>
&gt;       * What is your evaluation of the proposal?<br>
<br>
</span>I think it&#39;s of questionable importance and doesn&#39;t generalize well.<br>
For example, you can&#39;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&#39;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>