Function types versus arrays

Neal Gafter neal at gafter.com
Wed Feb 17 16:54:46 PST 2010


On Wed, Feb 17, 2010 at 4:47 PM, Joshua Bloch <jjb at google.com> wrote:
>> This is all true, but the facts of the universe we live in have
>> conspired against us.  We should if we can, but we can't.
>
> Can't is a strong word.  All we can say is that it would involve VM change.
>  It may be worth that.

It would involve reifying generics uniformly (i.e. everywhere), which
is not backward compatible.  It may be worth that to you, but I think
it would be a disaster.

>> I should add that Howard relaunched this thread with the idea of
>> relaxing Java's usual assumption that a subtype conversion preserves
>> the identity of the reference.  I don't think that relaxation actually
>> solves the problem, and it does break other things in the language.
>> But it is worth spending some time determining if and how it breaks.
>
> I do not think this is a good idea. It violates the principle of least
> astonishment by sacrificing a fundamental truth of the language ("casting an
> object reference to an object reference type does not change its identity).

I don't think it is a good idea either, (nor do I think it works) but
it was you who said that we should do whatever it takes to make arrays
of functions work.  Perhaps you want to rethink that position.


More information about the lambda-dev mailing list