Nov. 16, 2010
9:17 a.m.
On Nov 16, 2010, at 9:20 AM, Michael Roberts wrote:
I don't really know the answer, but it is not about the implementation in Association. It is reasonable for associations to be equal if both their key & value are equal. The problem as you have seen is Float nan does not compare using #=.
Float nan = Float nan --> false
I don't the details but perhaps the clue is in the implementation of isNaN
isNaN "simple, byte-order independent test for Not-a-Number"
^ self ~= self
so something like this seems a better test
association := #foo -> Float nan. {association} anySatisfy: [:each | each value isNaN]
cheers, Mike
Thank you, it's a good clue :) It's not really cool to have to add special code to test NaN, but if it's the only way ... Ben