We're updating the issue view to help you get more done. 

PersistentQueue doesn't implement java.util.List, causing nontransitive equality

Description

PersistentQueue implements Sequential but doesn't implement java.util.List. Lists form an equality partition, as do Sequentials. This means that you can end up with nontransitive equality:

1 2 3 4 5 6 7 8 9 10 11 12 (def q (conj clojure.lang.PersistentQueue/EMPTY 1 2 3)) ;=> #user/q (def al (doto (java.util.ArrayList.) (.add 1) (.add 2) (.add 3))) ;=> #user/al (def v [1 2 3]) ;=> #user/v (= al v) ;=> true (= v q) ;=> true (not= al q) ;=> true

This happens because PersistentQueue is a Sequential but not a List, ArrayList is a List but not a Sequential, and PersistentVector is both.

Environment

None

Status

Assignee

Philip Potter

Reporter

Philip Potter

Labels

Approval

None

Patch

Code and Test

Affects versions

Release 1.4

Priority

Major