MethodHandles for Kawa and other functional languages?

Alessio Stalla alessiostalla at gmail.com
Thu Sep 30 06:28:20 PDT 2010


On Thu, Sep 30, 2010 at 3:11 PM, Helmut Eller <eller.helmut at gmail.com> wrote:
> * Alessio Stalla [2010-09-30 11:52] writes:
>
>> On Thu, Sep 30, 2010 at 12:48 PM, Helmut Eller  wrote:
>>>
>>> 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.
>
> Indeed, that should work.  Very clever.  I'm glad I asked you :-).

:)

> I guess you could avoid reflection if you generate a custom bootstrap
> method for each callsite.  Hmm.. probably just as clumsy as reflection.

Yeah, clumsy and suffering from code bloat - I'm already disturbed to
have one static block registering the bootstrap method for each class
(i.e. per compiled function). I'd have much preferred if bootstrap
method registration were inheritable. But that aside, after all
reflection will only be used the very first time the callsite is
linked, so it shouldn't be much of a problem.


More information about the mlvm-dev mailing list