> On Aug 16, 2016, at 12:44 PM, James Campbell via swift-evolution 
> <[email protected]> wrote:
> 
> That sounds fair, the closure that function returns could trigger a runtime 
> warning when it detects the closure has be deallocated without being 
> triggered (or even mutliple times but ofc not the focus for this proposal)

You know, I'm thinking about that "multiple times" thing...

We know we want a @once (formerly @noescape(once)) for closures which are 
guaranteed to be called exactly once. This would help us with initializing 
variables, and especially properties, from a closure. Perhaps we should extend 
that to support @escaping @once. Would that handle these use cases? Are there 
use cases for @required where you expect more than one call? I think all of the 
use cases we've discussed here—ending handlers and such—should only be called 
once.

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to