I every language I'm familiar with NaN tests unequal to all values, 
including itself. That's almost the definition of NaN.

This looks like some kind of shortcut where clojure is not bothering to 
test equality of a symbol with itself.

On Tuesday, October 9, 2012 1:48:54 PM UTC-7, Wes Freeman wrote:
>
> Possibly a simpler example:
>
> user=> (def x Float/NaN)
> #'user/x
> user=> (= x x)
> true
>
> I'm not sure whether true or false makes more sense, personally.
>
> Wes
>
> On Tue, Oct 9, 2012 at 4:38 PM, Brian Craft <[email protected]<javascript:>
> > wrote:
>
>> Can someone explain the last result here?
>>
>> > [1 2 3 Float/NaN]
>> [1 2 3 NaN]
>> > (= Float/NaN Float/NaN)
>> false
>> (#(= Float/NaN Float/NaN))
>> false
>> ; all is good so far, but...
>> (filter #(= % %) [1 2 3 Float/NaN 4])
>> (1 2 3 NaN 4)
>>
>> Now I'm lost. What just happened?
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to [email protected]<javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> [email protected] <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to