2009/8/13 lowly coder lowlycoder@huoyanjinjing.com:
The following confuses me even more:
You are mixing environments…
(define-macro (test) (define bar 3)
Bar is defined in the body of the macro
(pp (eval '(+ 1 2)))
No bindings here, no problem
(pp bar)
This is bound to 3
(pp (eval 'bar)))
This bar is in another world. Try to add the second parameter to eval (the environment), just to be sure
(test)
fail.
In other words, look at that (define-macro (foo) (define bar 3) (eval '(define bar "hi")) (pp bar) (eval '(pp bar)))
(foo)
See the point?
P!