Error formatting macro: pagetree: java.lang.NullPointerException

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. (defrecord TaggedLiteral [tag value])
    1. Has a print-method which does the #tagged/literal "thing"
  2. (defprotocol ILiteral (-literal [this]))
    1. Converts an object into a valid EDN structure
  3. Add pr, prn, pr-str, and prn-str to clojure.edn
    1. Implements closed set of print methods for each EDN type
    2. Calls -literal on every object recursively
    3. Throws if any object isn't one of the EDN types
An alternatively solution may replace the ILiteral protocol with a fn or map. That would allow for custom types to have multiple tagged literal representations depending on need.