Skip to content

Instantly share code, notes, and snippets.

@m2ym
Created March 14, 2012 07:53
Show Gist options
  • Select an option

  • Save m2ym/2034942 to your computer and use it in GitHub Desktop.

Select an option

Save m2ym/2034942 to your computer and use it in GitHub Desktop.
Walker and lexical environment
(in-package :cl-user)
(#+sbcl
sb-walker:walk-form
#+allegro
excl::walk-form
`(let ((x 1))
(declare (fixnum x))
:marker)
nil
(lambda (subform context env)
(declare (ignore context))
(when (eq subform :marker)
(print
(multiple-value-list
#+sbcl
(sb-cltl2:variable-information 'x env)
#+allegro
(sys:variable-information 'x env))))
subform))
; SBCL:
; (NIL NIL NIL)
; Allegro CL:
; (:LEXICAL NIL ((TYPE (INTEGER -1152921504606846976 1152921504606846975))) T)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment