[swift-users] @noescape

Jens Alfke jens at mooseyard.com
Mon May 16 11:41:29 CDT 2016


> On May 16, 2016, at 9:37 AM, Nate Birkholz via swift-users <swift-users at swift.org> wrote:
> 
> I understand how @noescape works, and some of its benefits, I *think*, but if I am correct, it almost seems like it should be added automatically to my closure definitions until it becomes clear that the closure has to escape its context, much like I tend to declare variables as `let` until it becomes clear I need a `var`. 

IIRC, there is a current proposal to change the language in exactly that way — i.e. to have noescape be the default and use an attribute like “@escapes” to declare that a closure can be stored by the callee and called later.

—Jens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160516/a923e98c/attachment.html>


More information about the swift-users mailing list