ClojureCLR v2.4 Release Notes

  • Clojure 1.6 provides new hashing algorithms for primitives and collections, accessible via IHashEq/hasheq (in Java) or the clojure.core/hash function (in Clojure). In general, these changes should be transparent to users, except hash codes used inside hashed 👍 collections like maps and sets will have better properties.

    Hash codes returned by the Java .hashCode() method are unchanged and continue to match Java behavior or conform to the Java specification as appropriate.

    Any collections implementing IHashEq or wishing to interoperate with Clojure collections should conform to the hashing algorithms specified in http://clojure.org/data_structures#hash and use the new function mix-collection-hash for the final mixing operation. Alternatively, you may call the helper functions hash-ordered-coll and hash-unordered-coll.

    Any details of the current hashing algorithm not specified on that page should be considered subject to future change.

    Related tickets for dev and regressions:

    • CLJ-1328 Make several Clojure tests independent of ordering
    • CLJ-1331 Update primitive vectors to use Murmur3 hash
    • CLJ-1335 Update hash for empty PersistentList and LazySeq
    • CLJ-1336 Make hashing mixing functions available in Clojure
    • CLJ-1338 Make Murmur3 class public
    • CLJ-1344 Update mapHasheq to call Murmur3 algorithm
    • CLJ-1348 Add hash-ordered-coll and hash-unordered-coll
    • CLJ-1355 Restore cached hashCode for Symbol and (uncached) hashCode for Keyword
    • CLJ-1365 Add type hints for new collection hash functions