This is the mail archive of the
guile@sources.redhat.com
mailing list for the Guile project.
Re: variable binding
Jost Boekemeier <jostobfe@calvados.zrz.TU-Berlin.DE> writes:
> [
> (define (foo) +)
> (foo)
> (define + -)
> (foo)
> doesn't work correctly in the current module system]
> Because Aubrey's evaluator replaces every symbol by a pointer to the
> location (not a pointer to a pointer to a location, which would be
> correct!) the code must examine every memoized expession and unmemoize
> the pointer back into the original symbol.
>
> That's why the new module system really needs a new evaluator. [among
> other things ...] :)
Aha. Are you designing the new module system in the way that uses a
pointer to a pointer to a location, as you illustrated by symbol ->
variable -> location -> value? In this case, variables will be memoized
and correct locations will be accessed at run-time.
Although it will be slower than the current model, I think it is okay
because 1) it is simpler and more flexible 2) top-level variable access
is relatively rare so it won't slow down the system significantly.