groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Theodorou <blackd...@gmx.org>
Subject Re: SAM type closure coercion
Date Wed, 18 Jan 2017 13:22:13 GMT

On 18.01.2017 14:09, Andres Almiray wrote:
> Agreed.
>
> I almost forgot about the special arity case of defining a closure as {
> /* do something */ } as it can be called with either 0 or 1 arguments,
> where as { -> } accepts no arguments and { x -> } takes exactly one
> argument.
>
> Would it a a good compromise to support plain typed arguments out of the
> box, that is { String arg0, int arg1 -> } vs { arg0, arg1 -> } ?

nothing prevents you from writing { String arg0, int arg1 -> } today. 
And yes, we can make that this helps.

bye Jochen

Mime
View raw message