<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=""><div class="">-1 for the proposal too</div><div class=""><br class=""></div><div class="">@nonescaping is more restrictive than escaping closure. You can’t pass a non escaping closure to a method that expects one, while the reverse is possible.</div><div class=""><br class=""></div><div class="">Nowadays, a method without any annotation defaults to be able to do anything. If we switch to non-escaping as the default, a method without annotation would be restricted in what it can do with the closure. That’s why I don’t think this is a good move.</div><div class=""><br class=""></div><div class="">for example:</div><div class=""><br class=""></div><div class="">func myfunc(closure: () -> Void) {</div><div class=""><span class="Apple-tab-span" style="white-space:pre">        </span>stdlibfunction(closure)<span class="Apple-tab-span" style="white-space:pre">        </span></div><div class="">}</div><div class=""><br class=""></div><div class="">Today, whatever the stdlib function annotation is, it will compile. By reversing the annotation, that code may compile or not depending the stdlib function annotation.</div><div class=""><br class=""></div><div class="">Forcing the newcomer to learn advanced optimization technic to be able to write a simple function is very bad IMHO.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div><blockquote type="cite" class=""><div class="">Le 23 juin 2016 à 23:06, Diego Sánchez via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> a écrit :</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class=""><b class="">* What is your evaluation of the proposal?</b></div><div class=""><br class=""></div><div class="">-1</div><div class=""><br class=""></div><div class="">I find myself using 3 types of closures:</div><div class=""> - Algorithm-like (filter, map etc.). non-escaping</div><div class=""> - Completion closures: asynchronous operations: network requests, many cocoa APIs, background image processing. escaping</div><div class=""> - Data/dependency providers: userProvider(forId id: String) -> User. escaping (ok, can be non-escaping sometimes too)</div><div class=""><br class=""></div><div class="">In the codebases I'm working with, escaping closures predominate clearly; and most of the non-escaping ones refer to usages of the standard library.</div><div class=""><br class=""></div><div class="">Another point comes when changing things. Consider the following code:</div><div class=""><br class=""></div><div class="">func doSomething(closure: () -> Void) {</div><div class=""><span class="" style="white-space:pre">        </span>self.doSomething2(closure)</div><div class="">}</div><div class=""><br class=""></div><div class="">func doSomething2(closure: () -> Void) {</div><div class=""><span class="" style="white-space:pre">        </span>self.doSomething3(closure)</div><div class="">}</div><div class=""><br class=""></div><div class="">func doSomething3(closure: () -> Void) {</div><div class=""><span class="" style="white-space:pre">        </span>closure()</div><div class="">}</div><div class=""><br class=""></div><div class="">If non-escaping is the default, and for some reason doSomething3's closure needs to change to escaping, then I would have to change all the callers as escaping.</div><div class=""><br class=""></div><div class="">To sump up, I see @noescape as something to opt-in for performance reasons (or better static analysis as it was mentioned during the initial discussion) but I don't think it's a good default.</div><div class=""><br class=""></div><div class=""><b class="">* Is the problem being addressed significant enough to warrant a change to Swift?</b></div><div class="">I don't think there's a problem that needs to be fixed.</div><div class=""><br class=""></div><div class=""><b class="">* Does this proposal fit well with the feel and direction of Swift?</b></div><div class="">Not really. I think escaping is a safe good default that works for all cases.</div><div class=""><br class=""></div><div class=""><b class="">* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?</b></div><div class="">NA</div><div class=""><br class=""></div><div class=""><b class="">* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?</b></div><div class="">Followed the discussion and read the proposal carefully.</div><div class=""><br class=""></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2016-06-22 6:03 GMT+01:00 Chris Lattner via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Swift community,<br class="">
<br class="">
The review of "SE-0103: Make non-escaping closures the default" begins now and runs through June 27. The proposal is available here:<br class="">
<br class="">
<a href="https://github.com/apple/swift-evolution/blob/master/proposals/0103-make-noescape-default.md" rel="noreferrer" target="_blank" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0103-make-noescape-default.md</a><br class="">
<br class="">
Reviews are an important part of the Swift evolution process. All reviews should be sent to the swift-evolution mailing list at<br class="">
<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="">
<br class="">
or, if you would like to keep your feedback private, directly to the review manager.<br class="">
<br class="">
What goes into a review?<br class="">
<br class="">
The goal of the review process is to improve the proposal under review through constructive criticism and contribute to the direction of Swift. When writing your review, here are some questions you might want to answer in your review:<br class="">
<br class="">
* What is your evaluation of the proposal?<br class="">
* Is the problem being addressed significant enough to warrant a change to Swift?<br class="">
* Does this proposal fit well with the feel and direction of Swift?<br class="">
* If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?<br class="">
* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?<br class="">
<br class="">
More information about the Swift evolution process is available at<br class="">
<br class="">
<a href="https://github.com/apple/swift-evolution/blob/master/process.md" rel="noreferrer" target="_blank" class="">https://github.com/apple/swift-evolution/blob/master/process.md</a><br class="">
<br class="">
Thank you,<br class="">
<br class="">
-Chris Lattner<br class="">
Review Manager<br class="">
<br class="">
<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>
_______________________________________________<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>