Message from discussion
Broken equality for sets?
Date: Thu, 8 Nov 2012 21:46:12 -0800 (PST)
From: Justin Kramer <jkkra...@gmail.com>
To: clojure-dev@googlegroups.com
Message-Id: <1587bc4a-693c-4c6e-9534-ed967101802f@googlegroups.com>
Subject: Broken equality for sets?
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_Part_393_30699135.1352439972685"
------=_Part_393_30699135.1352439972685
Content-Type: multipart/alternative;
boundary="----=_Part_394_15879734.1352439972688"
------=_Part_394_15879734.1352439972688
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Steve Losh uncovered what looks like a bug:
https://gist.github.com/4043824
This affects Clojure 1.4 and 1.5 master. The offending line seems to be:
https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentSet.java#L58
If I understand correctly, equals should not be checking hashCode. That
check was removed from APersistentMap in the following commit:
https://github.com/clojure/clojure/commit/b5f5ba2e15dc2f20e14e05141f7de7c6a3d91179
I removed the hashCode check in a local branch, which appears to fix the
issue (and all tests pass). I can submit a patch if this is truly a bug.
Justin
------=_Part_394_15879734.1352439972688
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
Steve Losh uncovered what looks like a bug:<div><br></div><div>https://gist.github.com/4043824</div><div><br></div><div>This affects Clojure 1.4 and 1.5 master. The offending line seems to be:<br></div><div><br></div><div>https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/APersistentSet.java#L58<br></div><div><br></div><div>If I understand correctly, equals should not be checking hashCode. That check was removed from APersistentMap in the following commit:</div><div><br></div><div>https://github.com/clojure/clojure/commit/b5f5ba2e15dc2f20e14e05141f7de7c6a3d91179<br></div><div><br></div><div>I removed the hashCode check in a local branch, which appears to fix the issue (and all tests pass). I can submit a patch if this is truly a bug.</div><div><br></div><div>Justin</div>
------=_Part_394_15879734.1352439972688--
------=_Part_393_30699135.1352439972685--