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
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
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
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
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
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.)
-
: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
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
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
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
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
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 ...
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
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
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
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]
> 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
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
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
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
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
21 matches
Mail list logo