X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fpred.lisp;h=78a51c2a5951bcd2a0a610c76a73260d4a71b587;hb=02c9007b4ca5753406f60019f4fe5e5f8392541a;hp=79944d2c722114e18e5259c72713a64faee404b5;hpb=667ec9d494530079bef28e8589dd0d3274b935ec;p=sbcl.git diff --git a/src/code/pred.lisp b/src/code/pred.lisp index 79944d2..78a51c2 100644 --- a/src/code/pred.lisp +++ b/src/code/pred.lisp @@ -115,8 +115,8 @@ "Return the type of OBJECT." (if (typep object '(or function array complex)) (type-specifier (ctype-of object)) - (let* ((class (layout-class (layout-of object))) - (name (class-name class))) + (let* ((classoid (layout-classoid (layout-of object))) + (name (classoid-name classoid))) (if (typep object 'instance) (case name (sb!alien-internals:alien-value @@ -124,19 +124,9 @@ ,(sb!alien-internals:unparse-alien-type (sb!alien-internals:alien-value-type object)))) (t - (class-proper-name class))) + (classoid-proper-name classoid))) name)))) -;;; FIXME: This belongs somewhere else, perhaps in code/array.lisp. -(defun upgraded-array-element-type (spec) - #!+sb-doc - "Return the element type that will actually be used to implement an array - with the specifier :ELEMENT-TYPE Spec." - (if (unknown-type-p (specifier-type spec)) - (error "undefined type: ~S" spec) - (type-specifier (array-type-specialized-element-type - (specifier-type `(array ,spec)))))) - ;;;; equality predicates ;;; This is real simple, 'cause the compiler takes care of it. @@ -145,6 +135,19 @@ "Return T if OBJ1 and OBJ2 are the same object, otherwise NIL." (eq obj1 obj2)) +(defun bit-vector-= (x y) + (declare (type bit-vector x y)) + (if (and (simple-bit-vector-p x) + (simple-bit-vector-p y)) + (bit-vector-= x y) ; DEFTRANSFORM + (and (= (length x) (length y)) + (do ((i 0 (1+ i)) + (length (length x))) + ((= i length) t) + (declare (fixnum i)) + (unless (= (bit x i) (bit y i)) + (return nil)))))) + (defun equal (x y) #!+sb-doc "Return T if X and Y are EQL or if they are structured components @@ -162,15 +165,7 @@ (and (pathnamep y) (pathname= x y))) ((bit-vector-p x) (and (bit-vector-p y) - (= (the fixnum (length x)) - (the fixnum (length y))) - (do ((i 0 (1+ i)) - (length (length x))) - ((= i length) t) - (declare (fixnum i)) - (or (= (the fixnum (bit x i)) - (the fixnum (bit y i))) - (return nil))))) + (bit-vector-= x y))) (t nil))) ;;; EQUALP comparison of HASH-TABLE values @@ -214,7 +209,7 @@ (len (layout-length layout-x))) (and (typep y 'instance) (eq layout-x (%instance-layout y)) - (structure-class-p (layout-class layout-x)) + (structure-classoid-p (layout-classoid layout-x)) (do ((i 1 (1+ i))) ((= i len) t) (declare (fixnum i))