Presumably it then compares the objects element by element. If the common case is for the arguments to (= x y) to be unequal with unequal hashes, though, this is still considerably faster.
On Thu, Nov 28, 2013 at 5:03 PM, Andy Smith <the4thamig...@googlemail.com>wrote: > Hi, > > I heard Rich Hickey talking about how identity in clojure is synonymous > with value-based tests of equality. To make this efficient he describes > that objects store cached hashes that are used to speed up these tests of > equality, so clojure isnt comparing every data member of a complex data > structure. However, how does this actually work since a comparison of > hashes doesn't guarantee that two objects are equal. How does clojure > handle the case where two hashes are the same for two distinctly different > values. > > Andy > > -- > -- > 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 > Note that posts from new members are moderated - please be patient with > your first post. > 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 > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- -- 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 Note that posts from new members are moderated - please be patient with your first post. 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.