Convey print-length to pprint and allow set!

This commit is contained in:
Michiel Borkent 2022-04-16 11:36:06 +02:00
parent e3a6dbacb3
commit 4bfe0eec89
4 changed files with 20 additions and 2 deletions

View file

@ -5,6 +5,10 @@ For a list of breaking changes, check [here](#breaking-changes).
A preview of the next release can be installed from
[babashka-dev-builds](https://github.com/babashka/babashka-dev-builds).
## Unreleased
- Convey `*print-length*` to pprint and allow `set!`
## 0.8.1 (2022-04-15)
- Add `prepare` subcommand to download deps & pods and cache pod metadata

View file

@ -95,7 +95,8 @@
pprint/*print-pprint-dispatch* @print-pprint-dispatch
pprint/*print-miser-width* @print-miser-width
*print-meta* @sci/print-meta
*print-readably* @sci/print-readably]
*print-readably* @sci/print-readably
*print-length* @sci/print-length]
(pprint/pprint s writer))))
(defn cl-format

View file

@ -711,7 +711,8 @@ Use bb run --help to show this help output.
(sci/binding [core/warn-on-reflection @core/warn-on-reflection
core/unchecked-math @core/unchecked-math
core/data-readers @core/data-readers
sci/ns @sci/ns]
sci/ns @sci/ns
sci/print-length @sci/print-length]
(let [{version-opt :version
:keys [:shell-in :edn-in :shell-out :edn-out
:help :file :command-line-args

View file

@ -0,0 +1,12 @@
(ns babashka.pprint-test
(:require
[babashka.test-utils :as test-utils]
[clojure.string :as str]
[clojure.test :as test :refer [deftest is]]))
(defn bb [& args]
(str/trim (apply test-utils/bb (map str args))))
(deftest print-length-test
(is (= "(0 1 2 3 4 5 6 7 8 9 ...)"
(bb "-e" "(set! *print-length* 10) (clojure.pprint/pprint (range 20))"))))