This is the mail archive of the guile@cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: eval


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]