This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: Understanding eval2 and local-eval
- To: "Dale P. Smith" <dpsm at en dot com>
- Subject: Re: Understanding eval2 and local-eval
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 24 May 2000 23:07:42 +0200
- Cc: "guile at sourceware dot cygnus dot com" <guile at sourceware dot cygnus dot com>
- Cc: djurfeldt at nada dot kth dot se
- References: <00May24.155422edt.17030@gateway.elms.k12.oh.us>
"Dale P. Smith" <dpsm@en.com> writes:
> How do you use eval2?
Each module in the current system has something called a lookup
closure. It can be retrieved using the selector
module-eval-closure MODULE
While `local-eval' takes a lexical environment as second arg, eval2
takes a lookup closure as second arg. So, eval2 evals on a ceratin
module's "top-level".
> Is there a way to remove definitions from an environment? The macro
> undefine only works at the top-level.
No. But if you know the structure of the current lexical
environments, you can do it. I wouldn't advise using either `eval2'
or `local-eval', though.