X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftypedefs.lisp;h=e8480f1cc0b5cf3b27019b5abd43f31b219358dd;hb=a6a12ed609d5467ec43b411283e5b3568fee81df;hp=2aca4c36f42eb00143030f01ab5f6c192c5a5323;hpb=4898ef32c639b1c7f4ee13a5ba566ce6debd03e6;p=sbcl.git diff --git a/src/code/typedefs.lisp b/src/code/typedefs.lisp index 2aca4c3..e8480f1 100644 --- a/src/code/typedefs.lisp +++ b/src/code/typedefs.lisp @@ -42,23 +42,27 @@ (multiple-value-bind (whole wholeless-arglist) (if (eq '&whole (car arglist)) (values (cadr arglist) (cddr arglist)) - (values (gensym) arglist)) + (values (sb!xc:gensym) arglist)) (multiple-value-bind (forms decls) (parse-body body :doc-string-allowed nil) `(progn (!cold-init-forms - (setf (info :type :translator ',name) - (lambda (,whole) - (block ,name - (destructuring-bind ,wholeless-arglist - (rest ,whole) ; discarding NAME - ,@decls - ,@forms))))) + (let ((fun (lambda (,whole) + (block ,name + (destructuring-bind ,wholeless-arglist + (rest ,whole) ; discarding NAME + ,@decls + ,@forms))))) + #-sb-xc-host + (setf (%simple-fun-arglist (the simple-fun fun)) ',wholeless-arglist) + (setf (info :type :translator ',name) fun))) ',name)))) ;;; DEFVARs for these come later, after we have enough stuff defined. (declaim (special *wild-type* *universal-type* *empty-type*)) +(defvar *type-random-state*) + ;;; the base class for the internal representation of types (def!struct (ctype (:conc-name type-) (:constructor nil) @@ -77,7 +81,11 @@ (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 #.(ash 1 15)) + (hash-value (random #.(ash 1 15) + (if (boundp '*type-random-state*) + *type-random-state* + (setf *type-random-state* + (make-random-state)))) :type (and fixnum unsigned-byte) :read-only t) ;; Can this object contain other types? A global property of our