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:

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

Activity

Show:
Philip Potter
December 11, 2012, 7:57 PM

Thanks Andy. Submitted a new patch, 002-clj-1059-asequential-rebased-to-cached-hasheq.diff, which supersedes 002-clj-1059-asequential.diff.

The patch 001-clj-1059-make-persistentqueue-implement-list.diff still applies cleanly, and is still an alternative to 002-clj-1059-asequential-rebased-to-cached-hasheq.diff.

Andy Fingerhut
January 30, 2014, 10:50 PM

With the commits to Clojure master made in the week leading up to Jan 30 2014, particularly changes to hasheq, patch 002-clj-1059-asequential-rebased-to-cached-hasheq.diff no longer applies cleanly.

Patch 001-clj-1059-make-persistentqueue-implement-list.diff still does.

Andy Fingerhut
March 31, 2014, 11:33 PM

This issue was run into again and a duplicate ticket CLJ-1374 created – later closed as a duplicate of this one. Just wanted to record that this issue is being hit by others besides those originally reporting it.

Andy Fingerhut
August 11, 2014, 7:37 AM

One or more commits made to Clojure master between Aug 1 2014 and Aug 10 2014 conflict with the patch 001-clj-1059-make-persistentqueue-implement-list.diff, and it no longer applies cleanly.

Andy Fingerhut
May 24, 2018, 5:39 AM

Patch 002-clj-1059-asequential-rebased-to-cached-hasheq-v2.patch is identical to 002-clj-1059-asequential-rebased-to-cached-hasheq.diff, but applies cleanly to latest Clojure master as of 2018-May-23. Kept attribution of the original patch.

Assignee

Philip Potter

Reporter

Philip Potter

Labels

Approval

None

Patch

Code and Test

Affects versions

Priority

Major
Configure