[Openmcl-devel] accessing lexical variables (lexical-environment vs definition-environment)
mb at bese.it
Tue Jul 19 14:34:02 UTC 2005
i need a function which, at macro expansion time, collects the names
(as symbols) of all the visibile lexical variables. is there anything
which looks blatently wrong with this?
(defun lexical-variables (environment)
for env = environment
then (ccl::lexenv.parent-env env)
while (and env
(not (ccl::istruct-typep env 'ccl::definition-environment)))
for vars = (ccl::lexenv.variables env)
when (listp vars)
append (mapcar (lambda (var)
;; ccl::var-name is a macro, se we can't do #'ccl::var-name directly
in particular i want to make sure that i can stop looking for
variables as soon as i hit a definition-environment object.
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
More information about the Openmcl-devel