[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Refactoring dynamic roots

From: Marius Vollmer
Subject: Re: Refactoring dynamic roots
Date: Wed, 02 Feb 2005 14:55:30 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3 (gnu/linux)

Kevin Ryde <address@hidden> writes:

> Marius Vollmer <address@hidden> writes:
>> you want to give it its own dynamic state because that is very
>> useful.
> Do you have an example in mind?

Hmm, maybe running a repl: the code managing the repl and the cde that
is actually evaluated in it might each want to have their own dynamic
state.  For example, the current module of the evaluated code will
likely be different from the current module of the code that manages
the repl.

The behavior of eval would become more clean, in general.  For

  (eval '(define-module (foo)) (current-module))

will temporarily set the current module to (foo) as a side effect of
define-module, but eval will revert it to the module that was current
when eval was called.  If you want the current module change to stick,
you would have to use primitive-eval.

In contrast, you could use a dynamic state to carry 'dynamic state
information' from one call to eval to the next but while still being
isolated from changes to this state.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]