Skip to content

Pretty printing of unknown tagged literals incorrectly handles string #120

@plexus

Description

@plexus

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions