(class->factory record-class)
Returns the map-style record factory for the record-class
.
Returns the map-style record factory for the `record-class`.
(class->tag record-class)
Returns the tag symbol for the given record-class
.
Returns the tag symbol for the given `record-class`.
(data-reader tag tag-reader)
(data-reader tag tag-reader & more-tag-readers)
Returns a data-reader for a particular tag derived from one or more tag-readers.
Returns a data-reader for a particular tag derived from one or more tag-readers.
(pr-tagged-record-on this w)
Prints the EDN tagged literal representation of the record this
on the java.io.Writer w
.
Useful for implementing a print-method on a record class. For example:
(defmethod print-method my.ns.MyRecord [this w] (miner.tagged/pr-tagged-record-on this w))
Prints the EDN tagged literal representation of the record `this` on the java.io.Writer `w`. Useful for implementing a print-method on a record class. For example: (defmethod print-method my.ns.MyRecord [this w] (miner.tagged/pr-tagged-record-on this w))
(read)
(read stream)
(read options stream)
Like clojure.edn/read but the :default option is tagged-default-reader
.
Like clojure.edn/read but the :default option is `tagged-default-reader`.
(read-string s)
(read-string options s)
Like clojure.edn/read-string but the :default option is tagged-default-reader
.
Like clojure.edn/read-string but the :default option is `tagged-default-reader`.
(record-tag-reader tag val)
If the tag corresponds to a record class (for example, tag my.ns/Rec matches record
my.ns.Rec) and the val
is a map, use the record factory to return a value. Otherwise,
nil.
If the tag corresponds to a record class (for example, tag my.ns/Rec matches record my.ns.Rec) and the `val` is a map, use the record factory to return a value. Otherwise, nil.
(safe-tag-reader)
(safe-tag-reader tag-reader)
(safe-tag-reader r1 r2)
(safe-tag-reader r1 r2 r3)
(safe-tag-reader r1 r2 r3 & more)
Takes any number of tag-reader functions and returns a composite tag-reader which will either return a truthy value or throw an exception if the tag cannot be handled appropriately with the value.
Takes any number of tag-reader functions and returns a composite tag-reader which will either return a truthy value or throw an exception if the tag cannot be handled appropriately with the value.
(some-tag-reader)
(some-tag-reader tag-reader)
(some-tag-reader r1 r2)
(some-tag-reader r1 r2 r3)
(some-tag-reader r1 r2 r3 & more)
Takes any number of tag-reader functions and returns a composite tag-reader that applies the tag-readers in order returning the first truthy result (or nil if none).
Takes any number of tag-reader functions and returns a composite tag-reader that applies the tag-readers in order returning the first truthy result (or nil if none).
(tag->factory tag)
Returns the map-style record factory for the tag
symbol. Returns nil if tag
does not
refer to a record. Results are memoized.
Returns the map-style record factory for the `tag` symbol. Returns nil if `tag` does not refer to a record. Results are memoized.
Default data-reader for reading an EDN tagged literal as a Record. If the tag corresponds to a
known Record class (tag my.ns/Rec for class my.ns.Rec), use that Record's map-style factory on
the given map value. If the tag is unknown, use the tagged-literal
.
Default data-reader for reading an EDN tagged literal as a Record. If the tag corresponds to a known Record class (tag my.ns/Rec for class my.ns.Rec), use that Record's map-style factory on the given map value. If the tag is unknown, use the `tagged-literal`.
(throw-tag-reader tag val)
Always throws an exception for a tag
and val
.
Always throws an exception for a `tag` and `val`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close