Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by

In Clojure, this works:

(defmethod clojure.pprint/simple-dispatch
  my.ns.record
  [r] (print r))

But I can't find the equivalent in Cljs. With no success, I've tried:

(defmethod cljs.pprint/simple-dispatch
  my.ns.record
  [r] (print r))

I can't make any sense of the cljs.pprint documentation

1 Answer

0 votes
by

I ran into a similar problem, gave up and just converted my data into a JS objects and then printed it with console.log (in browser) or as pretty stringified json (not browser). I basically just needed something quick and dirty for debugging and didn't care to find the proper cljs way.

Also since the browser console has a great interface to interact with logged data, I was a great solution for my use case.

by
That's kinda sad. In my case it's more of a repl and DSL thing, so I guess I'll be writing a printing protocol and extending it to everything. Thanks.
...