(if (eq '&whole (car arglist))
(values (cadr arglist) (cddr arglist))
(values (gensym) arglist))
- (multiple-value-bind (forms decls) (parse-body body nil)
+ (multiple-value-bind (forms decls)
+ (parse-body body :doc-string-allowed nil)
`(progn
(!cold-init-forms
(setf (info :type :translator ',name)
(enumerable nil :read-only t)
;; an arbitrary hash code used in EQ-style hashing of identity
;; (since EQ hashing can't be done portably)
- (hash-value (random (1+ most-positive-fixnum))
+ (hash-value (random #.(ash 1 15))
:type (and fixnum unsigned-byte)
- :read-only t))
+ :read-only t)
+ ;; Can this object contain other types? A global property of our
+ ;; implementation (which unfortunately seems impossible to enforce
+ ;; with assertions or other in-the-code checks and constraints) is
+ ;; that subclasses which don't contain other types correspond to
+ ;; disjoint subsets (except of course for the NAMED-TYPE T, which
+ ;; covers everything). So NUMBER-TYPE is disjoint from CONS-TYPE is
+ ;; is disjoint from MEMBER-TYPE and so forth. But types which can
+ ;; contain other types, like HAIRY-TYPE and INTERSECTION-TYPE, can
+ ;; violate this rule.
+ (might-contain-other-types-p nil :read-only t))
(def!method print-object ((ctype ctype) stream)
(print-unreadable-object (ctype stream :type t)
(prin1 (type-specifier ctype) stream)))
(logand (logxor (ash (type-hash-value type1) -3)
(type-hash-value type2))
#xFF))
+#!-sb-fluid (declaim (inline type-list-cache-hash))
+(declaim (ftype (function (list) (unsigned-byte 8)) type-list-cache-hash))
+(defun type-list-cache-hash (types)
+ (logand (loop with res = 0
+ for type in types
+ for hash = (type-hash-value type)
+ do (setq res (logxor res hash))
+ finally (return res))
+ #xFF))
\f
;;;; cold loading initializations