|
From: | Mikael Djurfeldt |
Subject: | Re: current-environment |
Date: | Sat, 15 Mar 2003 10:26:45 +0100 |
User-agent: | Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 |
Aaron VanDevender <address@hidden> writes: > I just posted to guile-sources a patch which defines a > current-environment primitive. It allows you to hang on to an > environment and then eval things in that environment later. So > you can say stuff like this: > > (define env (let ((mesg "hello")) (current-environment))) > > (eval '(display mesg) env) > > => "hello" > > I debated for a long time whether this environment should also > carry the module context with it. i.e. should eval set the > current-module to the module that was current when > current-environment was called. I decided that it probably > shouldn't since the module doesn't get pulled in when you close > over an environment using lambda. Although I can sort of see the > other side since the current use of eval *only* sets the current > module. Anyway, I'd be interested to hear any discussion on this > issue or this feature in general. Including my reply on the guile-sources list (where I maybe shouldn't have replied, since that list is for source only):
--- Begin Message ---Subject: Re: current-environment Date: Sat, 15 Mar 2003 10:23:47 +0100 User-agent: Gnus/5.090015 (Oort Gnus v0.15) Emacs/21.2 Aaron VanDevender <address@hidden> writes: > Here is a patch which adds the ability to obtain an environment > and eval using it. Thank you for your patch! It is always nice to see people do intelligent things with the Guile source. But in this particular case: Doesn't this do the same thing as the combination of (the-environment) and (local-eval EXP ENV) ? I should add that there has been a lot of controversy about these two, since some people believe it would be an advantage for future compilers not to have to support this form of evaluation. Best regards, Mikael D.
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |