Christopher R. Barry <cbarry@2xtreme.net> wrote:
+---------------
| "H. Tunc Simsek" <simsek@EECS.Berkeley.Edu> writes:
| > (let ((x 1))
| > (eval (read-from-string "x")))
...
| EVAL evaluates its form in the current dynamic environment and the
| null lexical environment. The best you can do is:
|
| (progv '(x) '(1)
| (eval (read-from-string "x")))
+---------------
Yeah, that works, but might cause conflicts if the string contains inner
lexical bindings for "x", or if for some reason you didn't *want* "x" to
be dynamic. If he really wanted a lexical environment for EVAL, he could
always do something hacky like this:
(eval
`(let ((x 1))
,(read-from-string "x")))
-Rob
-----
Rob Warnock, 8L-846 rpw3@sgi.com
Applied Networking http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
1600 Amphitheatre Pkwy. FAX: 650-933-0511
Mountain View, CA 94043 PP-ASEL-IA