1.0.27.33: make various form orders deterministic
authorChristophe Rhodes <csr21@cantab.net>
Fri, 24 Apr 2009 11:11:17 +0000 (11:11 +0000)
committerChristophe Rhodes <csr21@cantab.net>
Fri, 24 Apr 2009 11:11:17 +0000 (11:11 +0000)
Usually involves sorting the output of a hash-table loop or set
operation.

3 commit messages follow:

make the order of (setf cl:foo) defining forms deterministic

alphabetize the automated out-of-line definitions of modular functions

Otherwise we go in hash-table order, which is not noticeably the same
between clisp and sbcl hosts.

UNION can return entries in arbitrary order

So SORT [a copy of: don't mutate the source code!] the UNION of
signed-num and unsigned-num by symbol name.

src/code/numbers.lisp
src/code/setf-funs.lisp
src/compiler/generic/primtype.lisp
version.lisp-expr

index 1c40555..525beb7 100644 (file)
@@ -1458,7 +1458,7 @@ the first."
       (do-mfuns sb!c::*untagged-unsigned-modular-class*)
       (do-mfuns sb!c::*untagged-signed-modular-class*)
       (do-mfuns sb!c::*tagged-modular-class*)))
-  `(progn ,@(forms)))
+  `(progn ,@(sort (forms) #'string< :key #'cadr)))
 
 ;;; KLUDGE: these out-of-line definitions can't use the modular
 ;;; arithmetic, as that is only (currently) defined for constant
index 5899a24..741fb61 100644 (file)
                    (or (info :setf :inverse sym)
                        (info :setf :expander sym))
                    (not (member sym ignore)))
-          (let ((type (type-specifier (info :function :type sym))))
-            (aver (consp type))
-            #!-sb-fluid (res `(declaim (inline (setf ,sym))))
-            (res (compute-one-setter sym type))))))
-    `(progn ,@(res))))
+          (res sym))))
+    `(progn
+      ,@(mapcan
+         (lambda (sym)
+           (let ((type (type-specifier (info :function :type sym))))
+             (aver (consp type))
+             (list
+              #!-sb-fluid `(declaim (inline (setf ,sym)))
+              (compute-one-setter sym type))))
+         (sort (res) #'string<)))))
 
 ) ; EVAL-WHEN
 
index 2ee50b0..2b5e2c6 100644 (file)
@@ -64,7 +64,7 @@
     #!-#.(cl:if (cl:= sb!vm::n-machine-word-bits 64) '(and) '(or))
     (:or signed-byte-32 fixnum unsigned-byte-31 positive-fixnum))
   (!def-primitive-type-alias untagged-num
-    (:or . #.(print (union (cdr '#1#) (cdr '#2#))))))
+    (:or . #.(sort (copy-list (union (cdr '#1#) (cdr '#2#))) #'string<))))
 
 ;;; other primitive immediate types
 (/show0 "primtype.lisp 68")
index 11dd54d..e40b624 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.27.32"
+"1.0.27.33"