Composing constructs
Once you know each primitive, the interesting question is how they stack: data feeding iteration feeding conditionals, captures fed by data access, definitions that use other definitions. This short bridge page shows the happy seams — and the two places where constructs intentionally do not compose, so you meet the errors before they surprise you.
Data, iteration, and conditionals together
The workhorse pattern — loop a collection of records, gate each with a condition:
#hands: [ { name - Ada, awake - true }, { name - Bo, awake - false } ] (each @hands as hand) (if @hand.awake is true) @hand.name is on watch. (end) (end)
Ada is on watch.
Data access works as a parameter value (access-in-param) and as a condition's left-hand side (access-in-condition).
Captures fed by data
A definition's captures can be filled from a data record read with dotted access:
#weil: { author - Simone Weil, work - Gravity and Grace } #cite ||author, work|| ::author::, _::work::_. cite# @cite |author @weil.author| |work @weil.work| cite@
Simone Weil, Gravity and Grace.
A definition body may reference another definition (def-of-def), and inline emphasis composes inside a block body:
@aside She _crossed_ the *threshold* at dusk. aside@
(emphasis-inside-node-body.)
The seams that do not compose
Seam 1 —!! is not a use-side closer. The !! token closes a value-block definition; it does not
short-close a node use. So an inner node left open inside a body is never
closed by !! and you get E_UNCLOSED_NODE. Close inner nodes with their own name@.
A bare @inset on its own line opens a block that expects inset@; if the surrounding body closes first, it hits the wrong
closer — E_MISMATCHED_CLOSE. A script that injects rendered content must
supply balanced open/close, not a half-open node.
Common mistakes
- Using
!!to close a node use — it closes a value-block definition only. - Expecting a script-injected node to auto-close — supply its
name@.
See also
Iteration· Conditionals · Interpolation & captures · Multi-file references · Derived content · Gotchas