0.7.9.1:
[sbcl.git] / src / code / target-sxhash.lisp
index 7dfcd3e..347fc5c 100644 (file)
@@ -26,9 +26,9 @@
 ;;; desiderata:
 ;;;   * Non-commutativity keeps us from hashing e.g. #(1 5) to the
 ;;;     same value as #(5 1), and ending up in real trouble in some
-;;;     special cases like bit vectors the way that CMUCL SXHASH 18b
+;;;     special cases like bit vectors the way that CMUCL 18b SXHASH 
 ;;;     does. (Under CMUCL 18b, SXHASH of any bit vector is 1..)
-;;;   * We'd like to scatter our hash values the entire possible range
+;;;   * We'd like to scatter our hash values over the entire possible range
 ;;;     of values instead of hashing small or common key values (like
 ;;;     2 and NIL and #\a) to small FIXNUMs the way that the CMUCL 18b
 ;;;     SXHASH function does, again helping to avoid pathologies like
                    (logxor 422371266
                            (sxhash ; through DEFTRANSFORM
                             (class-name (layout-class (%instance-layout x)))))
+                   ;; Nice though it might be to return a nontrivial
+                   ;; hash value for other instances (especially
+                   ;; STANDARD-OBJECTs) there seems to be no good way
+                   ;; to do so. We can't even do the CLASS-NAME trick
+                   ;; (as used above for STRUCTURE-OBJECT) because
+                   ;; then CHANGE-CLASS would cause SXHASH values to
+                   ;; change, ouch! -- WHN recording wisdom of CSR
                    309518995))
               (symbol (sxhash x)) ; through DEFTRANSFORM
               (array