Trailing colon in ControlInvocationStatement?

Peter Levart peter.levart at marand.si
Fri Jan 8 04:50:20 PST 2010


On Friday 08 January 2010 13:03:55 Gernot Neppert wrote:
> Hello,
> 
> 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 ":"
> 
> Example:
> 
> this method
> 
> void foo(#void(String));
> 
> can be invoked like this:
> 
> foo(String s:)
> {
>   System.out.println(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.

Regards, Peter


More information about the closures-dev mailing list