[swift-evolution] Guaranteed closure execution
Gwendal Roué
gwendal.roue at gmail.com
Wed Apr 27 01:50:48 CDT 2016
> Hi Gwendal,
>
> I don’t think that the movement of @noescape affects the approach: I’d suggest that a proposal (e.g. Felix’s) go with:
>
> func f(closure: @noescape(once) () -> ()) { … }
>
> The semantics are clear: the closure is guaranteed to be called exactly once on all normal and “throw” paths. Paths that do not return in either of those ways (e.g. a call to abort) do not need to call the closure.
>
> IMO, this is a small scope proposal that is likely to be accepted.
The pull request is open: https://github.com/apple/swift-evolution/pull/271
Gwendal Roué
More information about the swift-evolution
mailing list