Project Lambda: Java Language Specification draft

Rémi Forax forax at univ-mlv.fr
Fri Jan 22 16:38:16 PST 2010


Le 22/01/2010 23:55, Alex Buckley a écrit :
> Attached is version 0.1 of a document that proposes changes to the 
> Java Language Specification in support of the first five sections of 
> the Project Lambda strawman.
>
> The document is an informal draft that in no way represents an 
> official update of the Java Language Specification.
>
> Many thanks to Neal and Josh for comments on an early version of this 
> document.
>
> Feedback to this mailing list is welcomed on bugs and omissions in the 
> text. Short code examples using lambda expressions as specified here 
> are also welcomed. I read and consider all mails to the list, but 
> cannot respond to every one individually.
>
> Alex
>
>
>
>    


Hi Alex,
nice writeup, I have only few comments.

In 15.8.6, there is an error in one example:

#() { if (..) return "1"; else return 2; } has type #Integer()

The type should be #Comparable<? extends Object&  Comparable<  ...>>()


In 15.8.6, there is no example with a checked exception:
#() { throw new IOException(); } has type #void() (throws IOException)


In 15.8.7, typo in the grammar, the last line:
'.' '(' ArgumentList_opt ')'
should be removed.

I don't like bang (!), because the following code is legal:
boolean a = true;
!#() (!a)!();   // true


In 4.10.4, I understand why #void() is a supertype of #int(),
but this may lead to some complications at runtime, because that is necessary
to pop the result value during the invocation.

Last section of 5.1.1' means that any function types can be casted
to a SAM type. I think I prefer to type 'this' in a lambda expression
converted using lambda conversion has an intersection type
between the SAM type and the function type.


I've noticed that there is no section about method references,
Is you spec will be modified to include method reference or
do you want to drop method references from the lambda spec.

cheers,
Rémi







More information about the lambda-dev mailing list