Method references with types [Re: lambda syntax tutorial]

John Nilsson john at milsson.nu
Fri Aug 6 19:36:09 PDT 2010


On Fri, Aug 6, 2010 at 4:30 AM, Brian Goetz <brian.goetz at oracle.com> wrote:
> For completeness:
>
>>> How about expressions?
>>>
>>> #String.length() + 2
>
> Type error.
>
>>> #A.getB().getC()
>
> Greedy.  Evaluate t=A.getB(), then evaluate to #t.getC().

If this is greedy, shouldn't the above example also be greedy? I.e.
t=String.length(), then t+2

I was kind of hoping for arbitrary expressions. So that it would
rather be intepreted as #(String s){s.length()+2}

BR,
John


More information about the lambda-dev mailing list