Liking cljdoc? Tell your friends :D

boring.data

The value vocabulary shared by both platforms.

CBOR has three things Clojure has no native counterpart for — simple values, the undefined value, and tagged values whose tag we do not interpret. They live here rather than in either implementation so the conformance suite can name them once.

The value vocabulary shared by both platforms.

CBOR has three things Clojure has no native counterpart for — simple values,
the `undefined` value, and tagged values whose tag we do not interpret. They
live here rather than in either implementation so the conformance suite can
name them once.
raw docstring

bytes-like?clj/s

(bytes-like? x)
source

bytes=clj/s

(bytes= a b)

Value equality for byte arrays.

Value equality for byte arrays.
sourceraw docstring

decimalclj/s

(decimal exponent mantissa)

A decimal fraction: mantissa * 10^exponent.

A decimal fraction: mantissa * 10^exponent.
sourceraw docstring

decimal-from-unscaledclj/s

(decimal-from-unscaled unscaled scale)

The inverse of decimal-unscaled / decimal-scale: a platform decimal from a BigDecimal-style unscaled value and scale.

On ClojureScript the unscaled value is narrowed back to an ordinary number when it fits, because that is the convention the reader itself uses and the writer encodes the two differently: a js/BigInt goes out as a bignum (tag 2/3) even when it is small, so skipping this made the same logical decimal encode as c4 8221 c241 96 here and c4 8221 1896 on the JVM -- a cross-platform byte divergence introduced by the round trip through this function, not present in the data.

The inverse of `decimal-unscaled` / `decimal-scale`: a platform decimal from
a BigDecimal-style unscaled value and scale.

On ClojureScript the unscaled value is narrowed back to an ordinary number
when it fits, because that is the convention the reader itself uses and the
writer encodes the two differently: a `js/BigInt` goes out as a bignum (tag
2/3) even when it is small, so skipping this made the same logical decimal
encode as `c4 8221 c241 96` here and `c4 8221 1896` on the JVM -- a
cross-platform byte divergence introduced by the round trip through this
function, not present in the data.
sourceraw docstring

decimal-scaleclj/s

(decimal-scale d)

The BigDecimal-style scale: value = unscaled * 10^-scale.

Accepts whatever the platform's decoder produced for CBOR tag 4 -- a real java.math.BigDecimal on the JVM, this namespace's Decimal stand-in on ClojureScript -- so portable code does not branch.

The BigDecimal-style scale: value = unscaled * 10^-scale.

Accepts whatever the platform's decoder produced for CBOR tag 4 -- a real
`java.math.BigDecimal` on the JVM, this namespace's `Decimal` stand-in on
ClojureScript -- so portable code does not branch.
sourceraw docstring

decimal-unscaledclj/s

(decimal-unscaled d)

The unscaled value, always as a big integer -- BigInteger on the JVM, js/BigInt on ClojureScript -- whatever its magnitude.

The unscaled value, always as a big integer -- `BigInteger` on the JVM,
`js/BigInt` on ClojureScript -- whatever its magnitude.
sourceraw docstring

decimal?clj/s

(decimal? x)
source

frame-nameclj/s

(frame-name x)

The wire type name of an unregistered tag-27 frame, as a string.

The wire type name of an unregistered tag-27 frame, as a string.
sourceraw docstring

frame-payloadclj/s

(frame-payload x)

The payload of an unregistered tag-27 frame: a field map for an UnknownRecord, whatever was written for a TaggedLiteral.

The payload of an unregistered tag-27 frame: a field map for an
`UnknownRecord`, whatever was written for a `TaggedLiteral`.
sourceraw docstring

rationalclj/s

(rational numerator denominator)
source

rational?clj/s

(rational? x)
source

record-fieldsclj/s

(record-fields x)

The field map of an UnknownRecord, as a plain map.

The field map of an UnknownRecord, as a plain map.
sourceraw docstring

record-typeclj/s

(record-type x)

The wire type name an UnknownRecord stands for.

The wire type name an UnknownRecord stands for.
sourceraw docstring

record-type-nameclj/s

(record-type-name x)

The canonical wire name for a record type, identical on both platforms.

On the JVM this is the class name, which already munges - to _. On ClojureScript the constructor's .name is MINIFIED under :advanced (a record printed as #my.ns.P{...} reports a type name of Vg), so the name is taken from pr-str, where the compiler embeds it as a string constant that survives minification — and then munged the same way, which is incognito's convention and the reason it has one.

The canonical wire name for a record type, identical on both platforms.

On the JVM this is the class name, which already munges `-` to `_`. On
ClojureScript the constructor's `.name` is MINIFIED under `:advanced`
(a record printed as `#my.ns.P{...}` reports a type name of `Vg`), so the
name is taken from `pr-str`, where the compiler embeds it as a string
constant that survives minification — and then munged the same way, which is
`incognito`'s convention and the reason it has one.
sourceraw docstring

simple-valueclj/s

(simple-value n)

A CBOR simple value with code n (0-255).

A CBOR simple value with code `n` (0-255).
sourceraw docstring

simple-value?clj/s

(simple-value? x)
source

tagged-frame?clj/s

(tagged-frame? x)

True for either fallback an unregistered tag-27 frame can decode to.

True for either fallback an unregistered tag-27 frame can decode to.
sourceraw docstring

tagged-valueclj/s

(tagged-value tag value)
source

tagged-value?clj/s

(tagged-value? x)
source

undefinedclj/s

CBOR's undefined — simple value 23. Distinct from nil, which is null (simple value 22).

CBOR's `undefined` — simple value 23. Distinct from nil, which is `null`
(simple value 22).
sourceraw docstring

unknown-recordclj/s

(unknown-record type fields)
(unknown-record type fields m)
source

unknown-record?clj/s

(unknown-record? x)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close