Fork me on GitHub
#clojure-uk
<
2022-01-10
>
dharrigan07:01:24

Good Morning!

cddr11:01:16

=> (= (m/ordered-map
    "bar" "bar"
    "foo" 42)
   (m/ordered-map
    "foo" 42
    "bar" "bar"))
true
;; wat??

cddr11:01:27

m is flatland’s ordered map

mccraigmccraig11:01:09

@cddr changes in ordering should not affect map equality should they ?

cddr11:01:42

I agree for a plain clojure map, but this is specifically named an ordered map

mccraigmccraig11:01:02

but the equality contract is defined for all maps

1
mccraigmccraig11:01:50

you could seq the ordered-maps and then compare to see if the ordering is different ?

👍 1
mccraigmccraig11:01:50

or define a specialised ordered= or something which returns false for ordered-maps with different orderings ?

Aron16:01:46

i wonder how that feature is called, 'update operator contract after you know the type'