piggieback
piggieback copied to clipboard
Pretty printing of unknown tagged literals incorrectly handles string
See https://github.com/lambdaisland/deja-fu#piggieback-printing
A literal like #time/time "10:11:12" will get parsed on the Clojure side to an UnknownTaggedLiteral, which then gets printed again. This printing on the Clojure side will output this as #time/time10:11:12.
This is the responsible handler:
(defmethod print-method UnknownTaggedLiteral
[^UnknownTaggedLiteral this ^java.io.Writer w]
(.write w (str "#" (.tag this) (.data this))))
I think the reason this implementation kind of works is because .toString on Clojure data structures yields a good serialization, but I think it would be better to recursively call print-method on (.data this). If that sounds reasonable I can make a PR for that.