In article <············@dalembert.cs.widener.edu> ····@cs.widener.edu (Sven Heinicke) writes:
>> (setq equation '(mod a b))
>> (let ((a 20)(b 7)) (eval equation))
>6
Eval evaluates its argument in the dynamic environment but not the
lexical environment. To get the effect you want, you would have to use
something like progv:
<cl> (setq foo '(mod a b))
(MOD A B)
<cl> (progv '(a b) '(20 7) (eval foo))
6
However, you probably don't want to use progv. There is almost
certainly a better way to accomplish whatever you're trying to do,
whether it's using funcall & apply, writing a mini interpreter, or
using macros. The first and third options have the advantage that your
code can be compiled.
--mark