;;; (unless (string= (gethash hash ht) string)
;;; (format t "collision: ~S ~S~%" string (gethash hash ht)))
;;; (setf (gethash hash ht) string))))
-;;; (format t "final count=~D~%" (hash-table-count ht)))
+;;; (format t "final count=~W~%" (hash-table-count ht)))
(defun %sxhash-simple-string (x)
(declare (optimize speed))
(defun sxhash (x)
(labels ((sxhash-number (x)
(etypecase x
- (fixnum (sxhash x)) ; through DEFTRANSFORM
+ (fixnum (sxhash x)) ; through DEFTRANSFORM
(integer (sb!bignum:sxhash-bignum x))
(single-float (sxhash x)) ; through DEFTRANSFORM
(double-float (sxhash x)) ; through DEFTRANSFORM
(class-name (layout-class (%instance-layout x)))))
309518995))
(symbol (sxhash x)) ; through DEFTRANSFORM
- (number (sxhash-number x))
(array
(typecase x
(simple-string (sxhash x)) ; through DEFTRANSFORM
(character
(logxor 72185131
(sxhash (char-code x)))) ; through DEFTRANSFORM
+ ;; general, inefficient case of NUMBER
+ (number (sxhash-number x))
(t 42))))
(sxhash-recurse x)))
\f