Skip to main content

reader

Jump to function (4)

reader/register-tag#

(register-tag tag-name f)

Registers a handler for reader tag tag-name (a string without the leading #). The handler f is a 1-arg function receiving the already-read form value and returning the value that should replace the tagged literal.

Re-registering an existing tag overwrites the previous handler.

Example:

(register-tag "date" my-ns/parse-date)
  ; later: #date "2026-04-20" => (my-ns/parse-date "2026-04-20")

reader/registered-tags#

(registered-tags)

Returns a sorted vector of the currently registered reader tag names.

Example:

(registered-tags) ; => ["inst" "regex" "uuid"]

reader/tag-registered?#

(tag-registered? tag-name)

Returns true if a handler is registered for reader tag tag-name.

Example:

(tag-registered? "inst") ; => true

reader/unregister-tag#

(unregister-tag tag-name)

Removes any handler registered for reader tag tag-name. Built-in tags can be unregistered but are re-installed on the next reader bootstrap.

Example:

(unregister-tag "date")