CX · Reference guideyaml
PlaygroundDownloadsAboutv0.18.0-pre.1

yaml

The yaml codec surface (core; spec/03-approved/core/codec.md §3), reached with [?lib 'cx-stdlib/yaml']. Four uniform verbs convert between yaml and the CX tree, which is the universal pivot: every conversion is format → tree → format, never format → format. Synthesized from the codec registry, so this surface cannot drift from what the build can actually convert.

yaml:parse

[$yaml:parse] -> any — Parse yaml source TEXT into a CXDM value.

yaml:parse-bytes

[$yaml:parse-bytes] -> any — Parse yaml source BYTES into a CXDM value — the binary half of the codec contract.

yaml:emit

[$yaml:emit] -> string — Emit a CXDM value as yaml TEXT.

yaml:emit-bytes

[$yaml:emit-bytes] -> bytes — Emit a CXDM value as yaml BYTES — the binary half of the codec contract.

yaml:emit-with-opts

[$yaml:emit-with-opts] -> string — Emit a CXDM value as yaml text under an option map (codec.md §3.2). The key set is CLOSED — an unknown key or an out-of-range value REFUSES rather than being silently ignored.

yaml:parse-many

[$yaml:parse-many] -> [sequence any] — Parse a yaml STREAM — documents separated by --- (a bare document after ... is the next one) — into the sequence of its documents, in order; one document is a sequence of one, an empty source the empty sequence. parse reads one document and refuses a stream naming this verb.

yaml:parse-many-bytes

[$yaml:parse-many-bytes] -> [sequence any] — parse-many over yaml source BYTES.