A standard protocol for making custom types in Clojure pretty print in the REPL and elsewhere.
(require '[pretty.core :as pretty])
(defrecord MyInt [i]
pretty/PrettyPrintable
(pretty [_] (list 'my-int i)))
(MyInt. 100)
;; -> (my-int 100)
A standard protocol for making custom types in Clojure pretty print in the REPL and elsewhere.
Repository Clojars Clojure Download