[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
current-environment
From: |
Aaron VanDevender |
Subject: |
current-environment |
Date: |
Fri, 14 Mar 2003 20:53:01 -0500 |
User-agent: |
Mutt/1.2.5.1i |
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.
cya
.sig
- current-environment,
Aaron VanDevender <=