Provisional API: This reference documents current compiler behavior. Compatibility is not yet promised.
src/components/collection-literals.x
Array and Map literals.
Functions
| Function | Summary |
|---|---|
array_literal | Builds an Array literal from its elements. |
map_literal | Builds a Map literal from its keys and values, alternating. |
Functions
array_literal
meta Code array_literal(Code code)
Builds an Array literal from its elements.
Source: src/components/collection-literals.x:14
map_literal
meta Code map_literal(Code code)
Builds a Map literal from its keys and values, alternating.
Source: src/components/collection-literals.x:32
Design notes
A collection literal builds its container with the counted constructor,
which receives each element converted to Var, in source order; an
empty brace among the elements is an empty Map. The compiler keeps the
elements in source order; see src/transform/literals.x.