Skip to content

Commit e3a80f3

Browse files
author
dnolen
committed
add cljs.pprint/pp macro
load cljs.pprint/pp and cljs.pprint/pprint in REPLs
1 parent f21ad27 commit e3a80f3

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/clj/cljs/repl.cljc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -730,7 +730,8 @@
730730
1 "NO_SOURCE_FILE")
731731
print-no-newline print
732732
source-map-inline true
733-
repl-requires '[[cljs.repl :refer-macros [source doc find-doc apropos dir pst]]]
733+
repl-requires '[[cljs.repl :refer-macros [source doc find-doc apropos dir pst]]
734+
[cljs.pprint :refer [pprint] :refer-macros [pp]]]
734735
bind-err true}
735736
:as opts}]
736737
(let [repl-opts (-repl-options repl-env)

src/cljs/cljs/pprint.clj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,8 @@ format-in can be either a control string or a previously compiled format."
142142
`(cljs.core/binding [cljs.pprint/*print-pprint-dispatch* ~function]
143143
~@body))
144144

145+
(defmacro pp
146+
"A convenience macro that pretty prints the last thing output. This is
147+
exactly equivalent to (pprint *1)."
148+
{:added "1.2"}
149+
[] `(cljs.pprint/pprint *1))

0 commit comments

Comments
 (0)