Hi,

On Thu 24 Jan 2013 21:28, Mark H Weaver <[email protected]> writes:

> "Andy Wingo" <[email protected]> writes:
>> commit dd02f3bd546f6a41d75785e8096b31b78e94167f
>> Author: Andy Wingo <[email protected]>
>> Date:   Thu Jan 24 13:20:54 2013 +0100
>>
>>     add rtl infrastructure for doing toplevel refs
>>     
>>     * libguile/vm-engine.c (current-module): New RTL VM instruction.
>
> How do you anticipate that this 'current-module' instruction will be
> used?

When a toplevel function is bound, it captures its current module.
Further toplevel references are made with respect to that module.  See
the load-program opcode in the old VM.

In the RTL vm, this value will get cached in a statically allocated
slot instead of a dynamically allocated vector.

At some point in the future, it would be nice to be able to figure out
what the module will be for any given function.  Psyntax could make a
module-ref instead of a toplevel-ref in that case.  I don't think that
works currently.  But until then, this is what we have.

Regards,

Andy
-- 
http://wingolog.org/

Reply via email to