On Sat, Jan 3, 2009 at 10:30 PM, Jason <jawo...@berkeley.edu> wrote:
>
>
>> You could put those three things in some kind of order of strictness :
>>
>> ==        : the same thing

== is only for numeric types. The Java == operator is called
identical? in Clojure.

>> contains? : has something of the same type and value
>> =         : the same value
>>
>
> Thanks for your posts.  I think I understand what happens now, but I
> still maintain that it's a bug.  In particular, the Java API says: "If
> two objects are equal according to the equals(Object) method, then
> calling the hashCode method on each of the two objects must produce
> the same integer result."  This contract is clearly violated by
> the .hashCode and .equals methods for Clojure vectors and lists:
>
> user> (.equals [1 2] '(1 2))
> true
> user> (list (.hashCode [1 2]) (.hashCode '(1 2)))
> (994 -1919631597)
>
> Cheers, Jason
> >
>



-- 
Venlig hilsen / Kind regards,
Christian Vest Hansen.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to