Bug in clojure.pprint wrt printing vars?

5 views
Skip to first unread message

Laurent PETIT

unread,
Jul 23, 2015, 9:54:08 AM7/23/15
to clojuredev-users
Hello,

Is the following behavior for pprint correct, when compared to raw call to print-method or to print?

;; Clojure 1.6.0
=> (use 'clojure.pprint)
nil

=> (def foo {})
#'user/foo

=> (print #'foo)
#'user/foo
nil

=> (pprint #'foo)
#<Var@14a19ffa: {}>
nil

=> (let [s (java.io.StringWriter.)]
     (print-method #'foo s)
     (str s))
"#'user/foo"

I would have expected pprint to be at least as human-readable than print?

The problem is showing up in REPL which replace call to print with call to pprint.

--
Laurent Petit
Reply all
Reply to author
Forward
0 new messages