[swift-evolution] [Pitch] Improving capturing semantics of local functions
mike.kluev at gmail.com
Wed Nov 22 08:10:18 CST 2017
On 21 November 2017 at 21:55, Mike Kluev <mike.kluev at gmail.com> wrote:
> maybe this?
> capture weak foo, loo, poo // "capture list", if present
> capture unowned bar, baz, booz // shall be at the beginning
> capture weak delegate = self.delegate! // before anything else
> compare to the current:
> weak foo, weak loo, weak poo
> unowned bar, unowned baz, unowned booz
> weak delegate = self.delegate!
> ] in
> a bit more explicit / expressive, looks like ordinary statements, and
> doesn't have that strange "in" at the end.
or even this:
weak capture foo, loo, poo
unowned capture bar, baz, booz
weak capture delegate = self.delegate!
// capture list if any has to be before anything else
weak var some = other
here "capture" is a noun, playing the role of "var" / "let".
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution