Liking cljdoc? Tell your friends :D

lambdaisland.data-printers

Provide a convenient interface for defining tagged print handlers for custom types. All register-... functions take the same arguments: [type tag to-edn]

  • type the type this handler is for (java.lang.Class or JS constructor)
  • tag the symbol used as tag, without the #
  • to-edn a function which takes the object to be printed, and returns plain data (vectors, maps, etc)
Provide a convenient interface for defining tagged print handlers for custom
types. All `register-...` functions take the same arguments: `[type tag to-edn]`

- `type` the type this handler is for (`java.lang.Class` or JS constructor)
- `tag` the symbol used as tag, without the `#`
- `to-edn` a function which takes the object to be printed, and returns plain
  data (vectors, maps, etc)
raw docstring

register-pprintclj/s

(register-pprint type tag to-edn)

Register pretty-print writer based on a class/type.

Register pretty-print writer based on a class/type.
sourceraw docstring

register-printclj/s

(register-print type tag to-edn)

Register a regular print handler. Extends clojure.core/print-method and clojure.core/print-dup on Clojure, and implements IPrintWithWriter on ClojureScript.

Register a regular print handler. Extends `clojure.core/print-method` and
`clojure.core/print-dup` on Clojure, and implements `IPrintWithWriter` on
ClojureScript.
sourceraw docstring

type-nameclj/s

(type-name t)

Given a class/type, return its name as a string. For ClojureScript this is a best effort, and you may need to give it a hand by setting a .-name property on your constructor function.

Given a class/type, return its name as a string. For ClojureScript this is a
best effort, and you may need to give it a hand by setting a `.-name` property
on your constructor function.
sourceraw docstring

type-name-pprint-dispatchcljsmultimethod

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close