Trailing colon in ControlInvocationStatement?
peter.levart at marand.si
Fri Jan 8 04:50:20 PST 2010
On Friday 08 January 2010 13:03:55 Gernot Neppert wrote:
> if I read the proposal for ControlInvocationStatement correctly, the
> invocation of a method that accepts a single lambda and no other
> parameters looks a little strange because of the trailing ":"
> this method
> void foo(#void(String));
> can be invoked like this:
> foo(String s:)
The syntax is not very precise on this, but I think the intention was that in both cases where either method has a single function type parameter and/or lambda has no parameters, the colon disappears. Formal parameter list has different syntax than argument list so there's no ambiguity.
More information about the closures-dev