Lightweight interfaces instead of function types

Rémi Forax forax at univ-mlv.fr
Sun Feb 21 04:22:22 PST 2010


Le 21/02/2010 07:46, Alex Buckley a écrit :

[...]

> Reifying function types as MethodHandles still has no specialization for
> primitive types, so won't give Doug what he needs.

Yes and no,
Method handles have a specialized method invoke.

MethodHandle mh = ldc virtual indexOf(char)int;
int index = mh.<int>invoke("foo", 'f');

invocation in this example doesn't require any boxing.

> Long story short:
> first-class functions in the Java language may be doomed without fully
> reified structural types in the Java VM. (Other languages can avoid
> primitive types or box them to their hearts' content, but again, that
> doesn't help Java programmer or Doug's library.)
>
> Hence my "peering over the edge of a very tall cliff" comment last week.
>
> Alex
>    

Rémi


More information about the lambda-dev mailing list