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

+1 vote
in Clojure by

Hi,

Doing some tests and arrived at the following scenario:

(assoc {##NaN nil} ##NaN nil)
=> {##NaN nil, ##NaN nil}

but trying to create a map like this is not possible:

{##NaN nil, ##NaN 1}

Could this be a bug in assoc? or is this the expected behavior

1 Answer

+2 votes
by

##NaN is not equal to anything else (including ##NaN), so you can't use it as a key in a map (probes to find it will never find it leading to strange behavior).

...