[Top][All Lists]

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

Re: eval

From: Dirk Herrmann
Subject: Re: eval
Date: Tue, 6 Feb 2001 10:41:16 +0100 (MET)

On 6 Feb 2001, Neil Jerram wrote:

>     >>  Interesting, but I can't think of any cases where it would be
>     >> useful not to do a (set-interaction-environment the-module*),
>     >> i.e.  for (interaction-environment) to be other than the
>     >> selected module's environment. [...]
>     Dirk> Well, I think there are actually only a _few_ situations
>     Dirk> where the result of (interaction-environment) should change:
>     Dirk> The repl itself can decide whether the interaction
>     Dirk> environment should be changed.  Further, if there is a GUI,
>     Dirk> the user might for example have a menu item "select
>     Dirk> interaction environment".  What other situations are there,
>     Dirk> where the interaction environment should change?
> Well, when the user types `(define-module ...)'.
> But my question was: what would be the meaning of the selected module
> and interaction-environment being different, and how would this state
> differ from that in which the module had not been selected?

The point is, that define-module need not be typed at the repl:  It can be
part of some code that is loaded, it can be part of some closure that is
executed, etc.  We wouldn't want the interaction-environment to change
with _every_ execution of define-module, would we?  We'd rather have more
fine grained control about the situations in which interaction-environment
changes than saying "every change to current-module also changes
interaction-environment".  Otherwise there is no need for a distinction.

Another example:  The selected module may change _temporarily_, for
example while evaluating some stuff.  During that period, however, the
real interaction environment did not change, because the temporarily
selected module will never be used by the repl to evaluate an expression.  
Thus, if (interaction-environment) was called while the selected module is
temporarily changed, it should not give wrong answers.

Best regards,
Dirk Herrmann

reply via email to

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