MethodHandles for Kawa and other functional languages?
Alessio Stalla
alessiostalla at gmail.com
Thu Sep 30 04:52:38 PDT 2010
On Thu, Sep 30, 2010 at 12:48 PM, Helmut Eller <eller.helmut at gmail.com> wrote:
> * Alessio Stalla [2010-09-30 07:44] writes:
>
>> InvokeDynamic.#"SOME-LISP-PACKAGE:FOO"(...)
>>
>> and in the bootstrap method, roughly,
>>
>> ...
>> Symbol sym = readFromString(methodName);
>> MethodHandle mh = sym.getSymbolFunctionOrDie().asMethodHandle();
>> ...
>
> Just out of curiosity: what do you do if the package was renamed (say
> from SOME-LISP-PACKAGE to ANOTHER-LISP-PACKAGE) before the bootstrap
> method gets executed?
It'll fail miserably :D I hadn't thought about that case, thanks for
pointing it out. The symbol should be available as a static field of
the caller function, so I should be able to get at it through
reflection: the name of the invoked method will then be the name of
that field.
Cheers,
Alessio
More information about the mlvm-dev
mailing list