Trying to work newer indy into JRuby

Charles Oliver Nutter charles.nutter at sun.com
Tue May 19 08:14:46 PDT 2009


Rémi Forax wrote:
> If you take a close look to the current API:
> http://download.java.net/jdk7/docs/api/java/dyn/MethodHandles.html
> there are not lot of primitive adapters, i.e adapters that can not be 
> written from
> the others.

Are these all functional right now? I could obviously use guardWithTest 
for my guarded handles without having custom Java code for it.

> The purpose of primitive adapters is to hep the language developer to fight
> the inherent complexity of dealing with polymorphic signature.
> 
> In case of Jython or JRuby (correct me if I'm wrong) but current 
> implementation
> massively use method with object as parameter type.
> 
> In that case, guards etc can be implemented using only convert, spread 
> and collect
> and the JavaMethodHandle.
> 
> But, for my pet project, for Groovy or for Neal's closure, you have to 
> deal with
> signatures including primitive types.
> In that case, insert/drop, permute and combine/guardWithTest are very 
> useful.

Actually we have as much need for the primitive support as Groovy, since 
we integrate almost as well with Java libraries and have a need to 
eliminate all the intermediate layers from our call protocols to and 
from Java code.

The current collection of primitive MHs already makes me giddy.

- Charlie



More information about the mlvm-dev mailing list