Error formatting macro: pagetree: java.lang.NullPointerException
Skip to end of metadata
Go to start of metadata
You are viewing an old version of this page. View the current version. Compare with Current  |   View Page History

Java collection types currently print as

#<ClassName {toString rep}>

As a result, their contents are not subject to control via Clojure's flags:

*print-length*, *print-level*

This is a big pain when working with big Java data at the REPL. I propose that, when their print forms are not overridden in derived classes, objects that implement the core Java collection interfaces print so that their contents are subject to the various print binding flags.


  1. Should they print like Clojure collections of the same shape, e.g.  [1 2] instead of <#ArrayList [1 2]>?

Note that print/read roundtripping is a non-objective:

  • no way to do it for arbitrary Java classes
  • adds significant complexity