Subject: [clisp-list] Eval and Scope

From: "Justice, Randy -CONT(DYN)" <[email-masked]>
Date: Wed Nov 14 07:22:39 2001

Hi.

First, thanks for all your help in the past...

I'm trying to use the "eval" function.. 

With the following defined. 

(setq mut-fun '(+ 1 2 3))

(defun test (x)
 
 (eval mut-fun)

)

One gets the correct information...
[56]> (test 1)
6

Changing the mut-fun to
[57]> (setq mut-fun '(+ x 1 2 3))
(+ X 1 2 3)
[58]> (test 1)
106

The "X" is a global variable, which has value of 100.
The function has a local "x" variable too.   

How do I use the local "x" variable?   
When global "X" is not defined, I get the following message
*** - EVAL: variable X has no value

Thanks for any help and insight..

Randy

---

From: [email-masked] (Dr. Edmund Weitz)
Date: Wed Nov 14 07:34:12 2001

See the CLHS:

"EVAL evaluates form in the current dynamic environment and the null
lexical environment."

So, EVAL won't be able to see the lexical binding of X.

Edi.