This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: eval inside let
> From: thi <ttn@mingle.glug.org>
>
> `local-eval' takes two args, the first an expression and the second a
> macro that references the environment to be considered "local". at
> least, this is what i get from reading libguile/debug.c... anyway, try:
>
> (let ((foo 'bar)) (local-eval (display foo) the-environment))
>
> note that you don't need to quote the first arg.
If true, that would be a bug. The whole point of EVAL is to evaluate
an expression constructed on the fly. If it auto-quotes everything
it becomes just a stupid name for the identity function.
> (hmm, when i use a quote, guile seems to hang
I dare anybody to say that isn't (or wouldn't be) a bug.
-- does anyone else see this?)
I don't. I get "ERROR: Unbound variable: the-environment" whether I
quote or not.
On the other hand, if you think you need this function (LOCAL-EVAL),
you may be way off base. Ask yourself: how would I write this in C?
Many people who think they want some flavor of EVAL really want to
treat functions as data, which is much simpler.
--
-- Keith Wright <kwright@free-comp-shop.com>
Programmer in Chief, Free Computer Shop <http://www.free-comp-shop.com>
--- Food, Shelter, Source code. ---