On 21 November 2017 at 21:55, Mike Kluev <[email protected]> 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
>
> foo()
> ...
> }
>
> compare to the current:
> {
> [
> weak foo, weak loo, weak poo
> unowned bar, unowned baz, unowned booz
> weak delegate = self.delegate!
> ] in
>
> foo()
> ...
> }
>
> 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
foo()
...
}
here "capture" is a noun, playing the role of "var" / "let".
Mike
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution