X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Flexenv.lisp;h=5eba1fabae94d93bef1bebb955e84a4302d46afb;hb=5ecef987f3847ed5de8c03f66ef9d8ab468af993;hp=f89df357b97163ceaf12c608d5c727a622abded5;hpb=0794cd3908a441222f430ba0cf3bb7c3e1a96c63;p=sbcl.git diff --git a/src/compiler/lexenv.lisp b/src/compiler/lexenv.lisp index f89df35..5eba1fa 100644 --- a/src/compiler/lexenv.lisp +++ b/src/compiler/lexenv.lisp @@ -15,19 +15,13 @@ ;;; (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 ()) - (:constructor make-null-interactive-lexenv - (&aux (policy (list '(safety . 3) - '(compilation-speed . 2) - '(debug . 2) - '(speed . 1) - '(space . 1) - '(inhibit-warnings . 1))))) + (:print-function print-lexenv) + (:constructor make-null-lexenv ()) (:constructor internal-make-lexenv (funs vars blocks tags type-restrictions lambda cleanup handled-conditions - policy))) + disabled-package-locks policy))) ;; an alist of (NAME . WHAT), where WHAT is either a FUNCTIONAL (a ;; local function), a DEFINED-FUN, representing an ;; INLINE/NOTINLINE declaration, or a list (MACRO . ) (a @@ -64,6 +58,8 @@ (cleanup nil) ;; condition types we handle with a handler around the compiler (handled-conditions *handled-conditions*) + ;; lexically disabled package locks (list of symbols) + (disabled-package-locks *disabled-package-locks*) ;; the current OPTIMIZE policy (policy *policy* :type policy)) @@ -74,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))