On Jan 14, 6:01 pm, Jason Wolfe <jawo...@berkeley.edu> wrote:
> I've already posted here [1] and on the issue board [2] about
> hashing.  In particular, .hashCode for seqs/colls break the Java
> contract that whenever (.equals x y), (= (.hashCode x) (.hashCode
> y)).  (let x = [1] and y = (seq [1])).  As I've mentioned earlier, I
> hope that eventually .hashCode and .equals will be brought into line.
> Anyway, I won't rehash (ha ha) this issue further here.

As I posted in the other thread, Rich just fixed this ... thanks!


> Anyway, I've also since realized that .equals and = are not the same
> thing, in particular with respect to numbers.  So, it might be nice to
> have a different hash function (i.e., Clojure's "hash"), that matches
> the behavior of =, and allow the user to specify which hash function
> they'd like to use when creating hash-sets and hash-maps.  

Following up, if the multiple-hash-function route is one that people
like, it might also be nice to have the option to make Clojure
identity hash-maps and sets, which use System.identityHashCode() and
identical?.

-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
-~----------~----~----~----~------~----~------~--~---

Reply via email to