lambda/lambda/langtools: initial lambda push; the current prototype suuports the following features:

Rémi Forax forax at univ-mlv.fr
Sat May 29 07:44:04 PDT 2010


Le 28/05/2010 17:04, Maurizio Cimadamore a écrit :
> On 28/05/10 15:40, Rémi Forax wrote:
>> I've found some bugs :)
>>
>> // this doesn't compile - how to declare a function type that doesn't 
>> takes any parameter ?
>> #int() bar;
>
> I'm in the process of fixing this...

Ok, it now works.

>>
>>
>> // in my opinion, an instruction can start with a lambda that has a 
>> body,
>> // but the hand-coded grammar of the compiler doesn't allow that.
>> #(int x) { System.out.println(x); }.();
>>
>> // Open question: can an instruction starts with a lambda expression ?
> Good question; my choice has been to make lambda a plain expression, 
> rather than an expression statement; this way it is mandatory to 
> always wrap a lambda either within a function type or within a SAM type.

So the following code is legal even if it's stupid.

#() (2).();

Catching this case requires to complexify the grammar
so I think it doesn't worth it.
I can live with that.

Rémi


More information about the lambda-dev mailing list