Pitch: Syntactic sugar for circumventing closure capture lists

I have to say that I think this is moving in the wrong direction. Using self.foo to mean { self.foo($0, $1, ...) } has the problems you mentioned, but I also think it's less clear in practice, and it doesn't support a bunch of things that regular closures do. It also makes source compatibility harder (you can't add a parameter with a default today, though maybe that should work) and doesn't interact too well with overloading (it'd be better if the labels were required: self.foo(_:bar:)).

To counter my abstract points, can you link to some of your real-world uses of this, so that we can see it in context?

3 Likes