Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

user=> (let [a (array-map Double/NaN 1)] (assoc a (key (first a)) "foo")) {NaN 1, NaN "foo"} user=> (let [a (hash-map Double/NaN 1)] (assoc a (key (first a)) "foo")) {NaN "foo"}

Approach: Array-map's comparison skips identity-check and always delegates to .equals calls. The attached patch alignes array-map behaviour with hash-map by doing the appropriate pointer checks before delegating to .equals

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1792 (reported by bronsa)
...