ClojureCLR v2.10 Release Notes

  • All of the functions that construct sets such as set and sorted-set allow duplicate elements to appear in their arguments, and they are documented to treat this case as if by repeated uses of conj.

    Similarly, all map constructor functions such as hash-map, array-map, and sorted-map allow duplicate keys, and are documented to treat this case as if by repeated uses of assoc.

    As before, literal sets, e.g. #{1 2 3}, do not allow duplicate elements, and while elements can be expressions evaluated at run time such as #{(inc x) (dec y)}, this leads to a check for duplicates at ⚙ run time whenever the set needs to be constructed, throwing an 👻 exception if any duplicates are found.

    Similarly, literal maps do not allow duplicate keys. New to Clojure 🐎 1.5 is a performance optimization: if all keys are compile time constants but one or more values are expressions requiring evaluation at run time, duplicate keys are checked for once at compile time only, not each time a map is constructed at run time.

    • CLJ-1065 Allow duplicate set elements and map keys for all set and map constructors