[#959] Add *print-readably* and *flush-on-newline*
This commit is contained in:
parent
6c1c33e9ac
commit
d4f5e57866
3 changed files with 9 additions and 2 deletions
2
sci
2
sci
|
|
@ -1 +1 @@
|
|||
Subproject commit a83009b81b68d60e0c1dd91f3a730e117599a122
|
||||
Subproject commit 1bacd92dd03d753c84b01a70f9fceb61fc96b667
|
||||
|
|
@ -89,7 +89,9 @@
|
|||
(pprint s @sci/out))
|
||||
([s writer]
|
||||
(binding [pprint/*print-right-margin* @print-right-margin
|
||||
pprint/*print-pprint-dispatch* @print-pprint-dispatch]
|
||||
pprint/*print-pprint-dispatch* @print-pprint-dispatch
|
||||
*print-meta* @sci/print-meta
|
||||
*print-readably* @sci/print-readably]
|
||||
(pprint/pprint s writer))))
|
||||
|
||||
(defn cl-format
|
||||
|
|
|
|||
|
|
@ -700,6 +700,11 @@ true")))
|
|||
|
||||
(vec (pmap f (map str (range 10000))))")))))
|
||||
|
||||
(deftest print-readably-test
|
||||
(is (= "\"foo\"" (bb nil "-e" "(binding [*print-readably* true] (pr-str \"foo\"))")))
|
||||
(is (= "foo" (bb nil "-e" "(binding [*print-readably* false] (pr-str \"foo\"))")))
|
||||
(is (= "foo\n" (bb nil "-e" "(binding [*print-readably* false] (with-out-str (clojure.pprint/pprint \"foo\")))"))))
|
||||
|
||||
;;;; Scratch
|
||||
|
||||
(comment
|
||||
|
|
|
|||
Loading…
Reference in a new issue