clojure .hashCode tests failure with ibm java.

2016-03-07 Thread Alex Miller
This is a known issue and we agree that the error is in the tests. However, we have not prioritized fixing it as it affects so few users (very few people run the Clojure build itself on the IBM jdk). You can see more on the ticket http://dev.clojure.org/jira/browse/CLJ-1678 -- You received thi

clojure .hashCode tests failure with ibm java.

2016-03-07 Thread raminder sodhi
uot;1"); BigInteger j = new BigInteger("9223372039002259457"); //String j = new String("9223372039002259457N"); //String j = new String("9223372039002259457N"); System.out.println(i.hashCode()); System.out.println(j.hashCode()); } } which has the

Re: Why can't I override equals & hashCode in defrecord?

2015-10-12 Thread Alex Miller
On Monday, October 12, 2015 at 9:23:28 AM UTC-5, Michael Sperber wrote: > > > Alex Miller writes: > > > I'm trying to say - Clojure does not and will not support this on > records > > (for good reasons) and deftype is the tool to use if you want custom > > equality semantics. > > I understa

Re: Why can't I override equals & hashCode in defrecord?

2015-10-12 Thread Michael Sperber
Alex Miller writes: > I'm trying to say - Clojure does not and will not support this on records > (for good reasons) and deftype is the tool to use if you want custom > equality semantics. I understand, that's fine. Now, my original post asked about programmers' ability to replicate defreco

Re: Why can't I override equals & hashCode in defrecord?

2015-10-12 Thread Alex Miller
On Monday, October 12, 2015 at 1:56:53 AM UTC-5, Michael Sperber wrote: > > > Alex Miller writes: > > > Records are (intentionally) map-like structures that are compared with > > value equality, just like maps. This will not change. > > Did you read the original post? That's exactly what I'm

Re: Why can't I override equals & hashCode in defrecord?

2015-10-11 Thread Michael Sperber
Alex Miller writes: > Records are (intentionally) map-like structures that are compared with > value equality, just like maps. This will not change. Did you read the original post? That's exactly what I'm trying to do. (Our tentative answer is to implement our own record-definition form.) -

Re: Why can't I override equals & hashCode in defrecord?

2015-10-11 Thread Alex Miller
:49:11 UTC-2, Michael Sperber > escreveu: >> >> I'm implementing some low-level data structures using arrays, and >> I'd like to use defrecord to make type for them. >> >> I need to override equals & hashCode, but defrecord won't let me do it. >&g

Re: Why can't I override equals & hashCode in defrecord?

2015-10-11 Thread Ricardo Mayerhofer
t; > I'm implementing some low-level data structures using arrays, and > I'd like to use defrecord to make type for them. > > I need to override equals & hashCode, but defrecord won't let me do it. > I know this has been discussed before: > > https://groups.goog

Why can't I override equals & hashCode in defrecord?

2015-02-11 Thread Michael Sperber
I'm implementing some low-level data structures using arrays, and I'd like to use defrecord to make type for them. I need to override equals & hashCode, but defrecord won't let me do it. I know this has been discussed before: https://groups.google.com/forum/#!topic/cloju

Re: hashCode?

2010-11-23 Thread Sunil S Nandihalli
ce that all the > > clojure-datastructures have a function called hashCode.. I saw it gave > > the same answer for the same native map/vector/set/list give the same > > number ... is it meant to be used by the end-user of clojure if so > > what things can we assume ab

Re: hashCode?

2010-11-23 Thread Sunil S Nandihalli
gt; clojure-datastructures have a function called hashCode.. I saw it gave > > the same answer for the same native map/vector/set/list give the same > > number ... is it meant to be used by the end-user of clojure if so > > what things can we assume about them? This is just out of c

Re: hashCode?

2010-11-23 Thread David Powell
On Tue 23/11/10 09:41 , Sunil S Nandihalli sunil.nandiha...@gmail.com sent: > Hello everybody, It is really nice that all the > clojure-datastructures have a function called hashCode.. I saw it gave > the same answer for the same native map/vector/set/list give the same > number ...

Re: hashCode?

2010-11-23 Thread Miki
Hello Sunil, >  It is really nice that all the clojure-datastructures have a function > called hashCode.. IIRC this comes from Java where every object has a hashCode method. > is it meant to be used by the end-user of clojure This is mostly used by Java (and in turn by Clojure) for

hashCode?

2010-11-23 Thread Sunil S Nandihalli
Hello everybody, It is really nice that all the clojure-datastructures have a function called hashCode.. I saw it gave the same answer for the same native map/vector/set/list give the same number ... is it meant to be used by the end-user of clojure if so what things can we assume about them

Re: Bug in .hashCode for vectors/lists (Old subject: "Bugs in contains? (?))

2009-01-15 Thread Jason Wolfe
Update: Rich just fixed this in http://code.google.com/p/ clojure/issues/detail?id=37&colspec=ID%20Type%20Status%20Priority %20Reporter%20Owner%20Summary">svn 1215 . -Jason --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Gro

Re: Bug in .hashCode for vectors/lists (Old subject: "Bugs in contains? (?))

2009-01-15 Thread Jason Wolfe
Er, oops, forgot you can't HTML here. Anyway, the upshot is that now user=> (import '(java.util ArrayList)) nil (doseq [s ['(1 2) (seq '(1 2)) [1 2] (seq [1 2]) (ArrayList. [1 2])]] (print "\n" (.hashCode s)) (doseq [t ['(1 2) (seq '(1 2)) [1 2]

Re: Bug in .hashCode for vectors/lists (Old subject: "Bugs in contains? (?))

2009-01-03 Thread Jason Wolfe
> However, it is a Java *contract* [1] that > (.equals x y) ==> (== (.hashCode x) (.hashCode y)) and currently > Clojure data structures violate this contract: > [1]http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html#hashCode() And, while on this subject, it's als

Bug in .hashCode for vectors/lists (Old subject: "Bugs in contains? (?))

2009-01-03 Thread Jason Wolfe
27; function directly: > > (hash v1) ==> 994 > (hash l1) ==> -1919631597 OK, I understand all of that. I still claim this is a bug. Clojure hashes are allowed to be more strict than Clojure =, I guess, although I would very much dislike this state of affairs. However, it is a

Re: Bug in .hashCode for vectors/lists (Old subject: "Bugs in contains? (?))

2009-01-03 Thread Christian Vest Hansen
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(Objec

Re: Bug in .hashCode for vectors/lists (Old subject: "Bugs in contains? (?))

2009-01-03 Thread Andrew Baine
On Sat, Jan 3, 2009 at 1:30 PM, Jason wrote: > 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 h

Bug in .hashCode for vectors/lists (Old subject: "Bugs in contains? (?))

2009-01-03 Thread Jason
at 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 meth