Is there a way to configure REPL to always pprint?

Too often, I wrapped expressions in pprint. Something tells me that there is an opportunity somewhere to do this automatically, but I can not find it. So, instead of typing this:

(pprint list-of-maps) 

I would just type

 list-of-maps 

in REPL and get a pretty printed result.

+8
clojure read-eval-print-loop
source share
1 answer

Just use

 (clojure.main/repl :print pprint) 

Found here .

From docs :

repl clojure.main

(repl and options)
...
-: print, a function of one argument, prints its argument to the output default: prn
...

+10
source share

All Articles