MethodHandles.dropArgument()

Rémi Forax forax at univ-mlv.fr
Wed Oct 1 16:41:45 PDT 2008


John Rose a écrit :
> On Oct 1, 2008, at 4:06 PM, Rémi Forax wrote:
>
>   
>> why MethodHandles.dropArgument() takes an argument valueType ?
>>     
>
> If mh2 = dropArgument(mh, 0), then mh2.invoke(x, abc...) == mh.invoke 
> (abc...).
> If mh.type is R(ABC...), then mh2.type is R(X, ABC...).
> The type X needs to be supplied explicitly when mh2 is created.
>
> Can we fix the javadoc to make this more obvious?
>   
ok, I see.
I drop an argument but in term of signature, i add a new parameter type.

As you know i am not a native english speaker :)
but i think a sentence can be added to say that the signature of the 
returned
method handle is the signature of the method handle taken as argument 
altered
by inserting the valueType at position pos.

And perhaps with a array like this could be added:
                                          method type taken as 
argument                method type returned
dropArgument(mh, 0,T)          type1, 
type2                                            T,type1,type2
dropArgument(mh,2,T)           
type1,type2                                             type1,type2,T

> -- John
>   
Rémi



More information about the mlvm-dev mailing list