hg: lambda/lambda/langtools: Minor syntactic changes:

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Mon Nov 29 09:33:39 PST 2010


On 29/11/10 17:26, Brian Goetz wrote:
>> Minor syntactic changes:
>> *) Lambda must start with the special token '#{' (no separator 
>> allowed between '#' and '{')
>> *) 'default' keyword on extension method is now optional (compiler 
>> warns you about it)
>
> You mean "extension" keyword, no?
Right 'extension'.

Summarizing, the two changes are meant to improve the usability of the 
lambda compiler. On the one hand we want to avoid stuff like:

SAM s = #
    {
      //doSomething
    };

(hence the single lambda token '#{')

On the other hand, we want to make extension method declaration more 
straightforward so that this:

interface I {
extension m() default Impl.foo;
}

can become simply:

interface I {
   m() default Impl.foo;
}

[as warmly suggested on this mailing list ;-) ]

Maurizio



More information about the lambda-dev mailing list