mvx-lang/mapfield 1.1.0
MAPFIELD — the %MAP% spec builder (Pick <-> JSON/YAML/XML projection) repository ↗
Install
MVPKG install mvx-lang/mapfield
About
mapfield
MAPFIELD — the portable %MAP% spec builder. A mapping says how a
document's fields become MultiValue attributes; MAPFIELD builds one field of
that spec, and spec-driven codecs (json, and later yaml/xml) consume it to
turn Pick dynamic arrays into structured data and back.
SPEC<-1> = MAPFIELD(name, attr, conv, type, assoc)
builds name<VM>attr<VM>conv<VM>type<VM>assoc:
- attr — the MV attribute the field lands at.
- type —
TEXT/NUMERIC/DATE/TIME; derived from conv when empty
(MD/MR/ML → NUMERIC, MT → TIME, D… → DATE, else TEXT).
- assoc — empty = a single-valued (scalar) field; else the association name,
whose members decode as parallel multivalues (an array of objects).
mvx vs udt
On mvx, MAPFIELD is a compiler builtin — this package is udt-only
(systems: udt). A consumer that compiles on both selects with a directive:
$IFDEF MVX
* MAPFIELD is the compiler builtin — nothing to declare
$ELSE
DEFFUN MAPFIELD(A, B, C, D, E) ; * this package's cataloged function
$ENDIF
Pure BASIC — installs by cataloging BP/MAPFIELD (no native build).
Consumers
json depends on mapfield (on udt); a yaml or xml package would too — one
shared projection layer, one parser each.