Welcome! Please see the About page for a little more info on how this works.

0 votes
in data.avl by

Comparing Clojure persistent sets to Java sets implementing java.util.Set interface returns true if the set of elements are the same, but not for data.avl sorted-sets.

`
user=> (def jset1 (java.util.HashSet. [5 7 11]))

'user/jset1

user=> (def avlset1 (avl/sorted-set 5 7 11))

'user/avlset1

user=> avlset1

{5 7 11}

user=> (def cset1 #{5 7 11})

'user/cset1

user=> (= cset1 jset1)
true
user=> (= jset1 cset1)
true

;; One might also expect true from comparisons below, like for the two above
user=> (= avlset1 jset1)
false
user=> (= jset1 avlset1)
false
`

2 Answers

0 votes
by

Comment made by: jafingerhut

The patch davl-10-v1.patch adds tests of which a few fail without the one-line proposed fix, which is modeled after how Clojure persistent set equiv works.

0 votes
by
Reference: https://clojure.atlassian.net/browse/DAVL-10 (reported by jafingerhut)
...