Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pretty printing of unknown tagged literals incorrectly handles string #120

Open
plexus opened this issue Jul 2, 2021 · 0 comments
Open

Comments

@plexus
Copy link
Contributor

plexus commented Jul 2, 2021

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant