A standard protocol for making custom types in Clojure pretty print in the REPL and elsewhere.
(defrecord MyInt [i]
PrettyPrintable
(pretty [_] (list 'my-int i)))
(MyInt. 100)
;; -> (my-int 100)
Can you improve this documentation?Edit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
Ctrl+k | Jump to recent docs |
← | Move to previous article |
→ | Move to next article |
Ctrl+/ | Jump to the search field |