I found Clojure's behavior confusing regarding equality between maps and records. In this first example, we have two different types that are structurally equal. The equality function = returns true:
user> (defn make-one-map [] {:a "a" :b "b"})
In the second example, we have hashmap and a record that are structurally equivalent, but the = function returns false:
user> (defrecord Titi [ab]) user.Titi user> (def titi (Titi. 1 2))
Why are there differences? I am using Clojure 1.3 and I found them very confusing.
source share