Lisp HUG Maillist Archive

WALKER question

Hi!

Consider the following example:

(defmacro test-env ((var) &body body &environment env)
  (format *trace-output* "~&env: ~:W" env)
  (format *trace-output* "~&lexical: ~S" (walker:variable-lexical-p var env))
  (format *trace-output* "~&env-lexicals: ~S"
          (walker::env-lexical-variables env))
  `(progn ,@body))

and

CL-USER 13 > (let ((x 500))
               (test-env (x)
                 (+ x 2)))
env: #S(LEXICAL::ENVIRONMENT LEXICAL::VARIABLES ((X . #:X))
                        LEXICAL::FUNCTIONS NIL
                        LEXICAL::REMOTE-ENVIRONMENT NIL)
lexical: NIL
env-lexicals: NIL
502

So, the binding of X is apparently contained in ENV but
walker:variable-lexical-p doesn't find it.  Is this a bug?  Or what am
I missing?

Regards,
-- 
Nils Gösche
"Don't ask for whom the <CTRL-G> tolls."

PGP key ID 0x0655CFA0


Updated at: 2020-12-10 09:00 UTC