On Feb 14, 9:13 pm, "Stephen C. Gilardi" <squee...@mac.com> wrote: > On Feb 14, 2009, at 11:10 PM, Chouser wrote: > > > I don't think that's quite right. I don't think it matters in this > > case, but hash values aren't guaranteed unique. A hash-map can have > > two keys with the same hash value as long as = returns false. Vectors > > and lists with the same values evaluate as equal: > > > user=> (= '(1 2) [1 2]) > > true > > Exactly right. Thanks for the correction.
Well, still not *quite* right, I believe. Last time I checked, Clojure "hash" matched Java .equals, which is not quite the same thing as Clojure "=". In particular, a set might contain two "=" numbers that are not ".equal" to each other: user> (= 1 (BigInteger. "1")) true user> (.equals 1 (BigInteger. "1")) false user> (hash-set 1 (BigInteger. "1")) #{1 1} -Jason --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---