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]

eval


Frode Vatvedt Fjeld writes:
 > 
 > 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
 > ...
Bindings of expressions in arguments to eval are taken from the
global environment.

 > 
 > 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?

(let ((x 'y))
    (local-eval '(display x) (the-environment)))

Klaus Schilling

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