pr-sequential-writer
function | since v0.0-1503 | Edit |
(pr-sequential-writer writer print-one begin sep end opts coll)
(defn pr-sequential-writer [writer print-one begin sep end opts coll]
(binding [*print-level* (when-not (nil? *print-level*) (dec *print-level*))]
(if (and (not (nil? *print-level*)) (neg? *print-level*))
(-write writer "#")
(do
(-write writer begin)
(if (zero? (:print-length opts))
(when (seq coll)
(-write writer (or (:more-marker opts) "...")))
(do
(when (seq coll)
(print-one (first coll) writer opts))
(loop [coll (next coll) n (dec (:print-length opts))]
(if (and coll (or (nil? n) (not (zero? n))))
(do
(-write writer sep)
(print-one (first coll) writer opts)
(recur (next coll) (dec n)))
(when (and (seq coll) (zero? n))
(-write writer sep)
(-write writer (or (:more-marker opts) "...")))))))
(-write writer end)))))