Method calls vs lambda calls

Neal Gafter neal at gafter.com
Tue Dec 15 08:21:26 PST 2009


On Tue, Dec 15, 2009 at 7:11 AM, Howard Lovatt <howard.lovatt at iee.org>wrote:

> I remain to be convinced that method references are a good idea, since
> they pull Java much further towards structural typing than at present
> and this will be very confusing for people to be presented with two
> type systems.
>

I don't know what this argument has to do about method references (are you
talking about function types?), but your argument makes no sense.  They're a
good idea because they will confuse people?  Huh?


> That desirability point aside, the technical issue of what name space
> a function type should be in can be resolved by putting a function
> type in both the method and the field/variable name spaces.


Function types are anonymous, and so don't need to go in any namespace.  Do
you mean a variable of function type?

Actually there are still some rough edges since methods are
> dynamically resolved and fields aren't. You can paper over this
>
difference a little by saying that function types can't be hidden.
>

What do you mean: hiding triggers an error (that would make code very
fragile, especially where the hidden name isn't even used)?  Or that the
name isn't hidden?

Cheers,
Neal


More information about the lambda-dev mailing list