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

print-dup form unreadable for collections without create(IPV)

Description

print-dup assumes all IPersistentCollections not defined via defrecord have a static create method that take an IPersistentCollection, but this is not true for many clojure collections

Printing

1 2 user=> (print-dup (sorted-set 1) *out*) #=(clojure.lang.PersistentTreeSet/create [1])

Can't read back

1 2 (read-string "#=(clojure.lang.PersistentTreeSet/create [1])") ClassCastException Cannot cast clojure.lang.PersistentVector to clojure.lang.ISeq java.lang.Class.cast (Class.java:3356)

Possible Fixes

  • add create methods taking IPersistentVector to collections

  • emit something different from print-dup

See also CLJ-1733.

Environment

None

Status

Assignee

Unassigned

Reporter

Nicola Mometto

Labels

Approval

Triaged

Patch

None

Priority

Major