Updated State of the Lambda

Brian Goetz brian.goetz at oracle.com
Fri Oct 15 15:30:21 PDT 2010


> I don't understand why # is infix for method reference.
> As you said you need to restrict the receiver form
> because a simple expression like #a.b.toString() is ambiguous.

I think the prefix notation (#ClassName.methodName) is more natural since the 
# is supposed to be the hint of "delayed evaluation of the next thing".  But 
there would definitely be ambiguities if we allowed arbitrary expressions of 
the form #e.methodName.  So our choices are to restrict the form of the 
expression, or to switch to an infix notation like ClassName#methodName, which 
is less problematic in terms of corner cases but personally I find it less 
natural.  IN these simple cases everything is fine, but in cases of chained 
references #a.b.c where there are conflicts between field names and method 
names, there are clear ambiguities that would have to be worked out.

> Is there a document explaining the translation proposed into bytecode ?

Well, the prototype compiler can be considered a document of sorts :)

THere is still the old translation document which is a little out of date. 
We'll be bringing it back into consistency with the compiler soon.  But before 
that I want to finish my work on compatibility guarantees for extension methods.



More information about the lambda-dev mailing list