I am trying to print a sequence such that neither the whole sequence is printed on one line, nor is each element of the sequence printed on its own line. E.g.
[10 11 12 13 14 15 16 17 18 19
20 21 22 23 24 25 26 27 28 29]
I found pprint-newline
in the documentation which indicates that allows me to determine how the newline gets printed. Unfortunately, I cannot find any examples on how it is to be used in conjunction with pprint
, and the doc string doesn't to offer much insight:
-------------------------
clojure.pprint/pprint-newline
([kind])
Print a conditional newline to a pretty printing stream. kind specifies if the
newline is :linear, :miser, :fill, or :mandatory.
This function is intended for use when writing custom dispatch functions.
Output is sent to *out* which must be a pretty printing writer.
pprint
specifies an optional second argument for the writer
, which is by default set to *out*
. However, I am not sure how to 'send' pprint-writer
to *out*
in this case, e.g. something like the example below doesn't appear to work
(clojure.pprint/pprint [1 2 3 4] (*out* (clojure.pprint/pprint-newline :miser)))