Using pprint with a protocol name generates an unending stream of output. pprint appears to recurse through the Var reference as the value of the :var key in the protocol definition itself.
Approach: Add a dispatch method which doesn't deref the Var
Screened by: Alex Miller
I've run across this issue while debugging Eastwood. It probably does more than what you want in terms of modifying pprint behavior, but check out eastwood.util/pprint-meta here: https://github.com/jonase/eastwood/blob/master/src/eastwood/util.clj#L206
The issue is that the simple-dispatch multifn dispatched a clojure.lang.Var to clojure.lang.IDeref, which dereferenced the Var before printing it. We have created a patch which dispatches a Var to the default print fn.
– With regards from the Amsterdam Clojure meetup group
Patch needs a test.
I added a test to the fix. Not sure if it is the right place for the test, any feedback is welcome.