X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Flexenv.lisp;h=5eba1fabae94d93bef1bebb955e84a4302d46afb;hb=3a2c2a2217f77e0d1a44a581c83e0311ebc2594a;hp=34b4a59e792caf3bd8098b048524a88a161135aa;hpb=62b0a9c5190806368487d46d8773734cb1ee3a25;p=sbcl.git diff --git a/src/compiler/lexenv.lisp b/src/compiler/lexenv.lisp index 34b4a59..5eba1fa 100644 --- a/src/compiler/lexenv.lisp +++ b/src/compiler/lexenv.lisp @@ -15,7 +15,8 @@ ;;; (This is also what shows up as an ENVIRONMENT value in macroexpansion.) #!-sb-fluid (declaim (inline internal-make-lexenv)) ; only called in one place (def!struct (lexenv - (:constructor make-null-lexenv ()) + (:print-function print-lexenv) + (:constructor make-null-lexenv ()) (:constructor internal-make-lexenv (funs vars blocks tags type-restrictions @@ -69,6 +70,15 @@ (null (make-null-lexenv)) (lexenv x))) +(defun null-lexenv-p (lexenv) + (equalp (coerce-to-lexenv lexenv) (make-null-lexenv))) + +(defun print-lexenv (lexenv stream level) + (if (null-lexenv-p lexenv) + (print-unreadable-object (lexenv stream) + (write-string "NULL-LEXENV" stream)) + (default-structure-print lexenv stream level))) + (defun maybe-inline-syntactic-closure (lambda lexenv) (declare (type list lambda) (type lexenv lexenv)) (aver (eql (first lambda) 'lambda))