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"}
方法: Array-map 的比较跳过了同一性检查并始终将调用委托给 .equals。在将调用委托给 .equals 之前,附带的补丁通过进行适当的指针检查使 array-map 的行为与 hash-map 一致。