0.9.2.38: thread cleanup, paranoid
[sbcl.git] / src / code / typecheckfuns.lisp
index 92adc90..e4a0d8b 100644 (file)
 
 ;;; Memoize the FORM which returns a typecheckfun for TYPESPEC.
 (defmacro memoized-typecheckfun-form (form typespec)
-  (let ((n-typespec (gensym "TYPESPEC")))
+  (with-unique-names (n-typespec)
     `(let ((,n-typespec ,typespec))
        (or (gethash ,n-typespec *typecheckfuns*)
           (setf (gethash ,n-typespec *typecheckfuns*)
 
 #+sb-xc
 (defun !typecheckfuns-cold-init ()
+  (/show0 "in typecheckfuns-cold-init")
   (setf *typecheckfuns* (make-hash-table :test 'equal))
   ;; Initialize the table of common typespecs.
   (setf *common-typespecs* #.*compile-time-common-typespecs*)
   ;; Initialize *TYPECHECKFUNS* with typecheckfuns for common typespecs.
+  (/show0 "typecheckfuns-cold-init initial setfs done")
   (macrolet ((macro ()
               `(progn
                  ,@(map 'list
                         (lambda (typespec)
-                          `(setf (gethash ',typespec *typecheckfuns*)
-                                 (lambda (arg)
-                                   (unless (typep arg ',typespec)
-                                     (typecheck-failure arg ',typespec))
-                                   (values))))
-                        *common-typespecs*))))
+                          `(progn
+                              (/show0 "setf")
+                              (setf (gethash ',typespec *typecheckfuns*)
+                                    (progn
+                                      (/show0 "lambda")
+                                      (lambda (arg)                                      
+                                        (unless (typep arg ',typespec)
+                                          (typecheck-failure arg ',typespec))
+                                        (values))))))
+                         *common-typespecs*))))
     (macro))
   (values))
 
           (member-type-p ctype)
           (numeric-type-p ctype)
           (array-type-p ctype)
-          (cons-type-p ctype))))
+           (cons-type-p ctype)
+           (intersection-type-p ctype)
+           (union-type-p ctype)
+           (negation-type-p ctype)
+           (character-set-type-p ctype))))
 
 ;;; Evaluate (at load/execute time) to a function which checks that
 ;;; its argument is of the specified type.
 ;;; The name is slightly misleading, since some cases are memoized, so
 ;;; we might reuse a value which was made earlier instead of creating
 ;;; a new one from scratch.
-(declaim (ftype (function (t) function) typespec-typecheckfun))
+(declaim (ftype (sfunction (t) function) typespec-typecheckfun))
 (defun typespec-typecheckfun (typespec)
   ;; a general-purpose default case, hopefully overridden by the
   ;; DEFINE-COMPILER-MACRO implementation