This is the mail archive of the
guile@cygnus.com
mailing list for the Guile project.
Re: eval
- To: Frode Vatvedt Fjeld <frodef@acm.org>
- Subject: Re: eval
- From: Maciej Stachowiak <mstachow@alum.mit.edu>
- Date: Tue, 06 Jul 1999 02:11:08 -0400
- CC: guile@sourceware.cygnus.com
- References: <2h7loewttc.fsf@dslab7.cs.uit.no>
Frode Vatvedt Fjeld wrote:
>
> I don't know too much about guile (or scheme in general), but I was a
> bit surprised to find this behaviour:
>
> guile> (let ((x 'y)) (eval '(display x)))
>
> ERROR: While evaluating arguments to display in expression (display x):
> ERROR: Unbound variable: x
> ...
>
> This works the way I expect it to under elk, for example. So does
> guile or elk have a problem, and how am I supposed to eval an
> expression in the local environment?
>
> Thanks for any help,
Guile's `eval' evaluates in the top-level environment by default.
Since let intruduces only local lexical bindings, it won't do the
trick.
However, Guile also has `local-eval' which should do what you
want.
- References:
- eval
- From: Frode Vatvedt Fjeld <frodef@acm.org>