Bug in clojure.pprint wrt printing vars?

50 views
Skip to first unread message

Laurent PETIT

unread,
Jul 23, 2015, 9:55:36 AM7/23/15
to cloju...@googlegroups.com
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

David Powell

unread,
Jul 23, 2015, 10:37:48 AM7/23/15
to cloju...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Clojure Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure-dev...@googlegroups.com.
To post to this group, send email to cloju...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojure-dev.
For more options, visit https://groups.google.com/d/optout.

Laurent PETIT

unread,
Jul 23, 2015, 10:46:38 AM7/23/15
to cloju...@googlegroups.com
Oh, great ! Thanks !
--
Laurent Petit
Reply all
Reply to author
Forward
0 new messages