0.9.1.51:
[sbcl.git] / src / compiler / lexenv.lisp
index d9d57f2..5eba1fa 100644 (file)
 ;;; (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
     (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))