Patterns¶
Self-contained recipes for the engine's flow-control features. Where the Synthmas walkthrough follows one dataset end-to-end, this section is the inverse: one feature per page, with a small focused example that exercises it.
In this section¶
- Multi-result mappings —
Rule()[],LoopOver, result-index dispatch, and how multi-result rules fan a source row into several CDM rows. - Conditionals (If / Else / Switch / Case) — branching inside a rule chain, the implemented syntax, when to reach for it.
- Fallback chains (
||) — try-this-then-that across blocks of rules, not just single rules. - Parallel collection (
++) — run independent blocks against the same input and collect every result.
Where the syntax lives¶
All four patterns are part of the new parser (1.4 and later). The
older single-rule || continues to work unchanged — see
DSL Guide → Conditional Chaining.
The block forms ({ ... }(:var) || { ... }(:var) and the ++
operator) and the If / Switch keywords are the new additions.
Every example below was lifted from a real test in the engine's test
suite — file pointers are at the bottom of each page. If a test name
is mentioned, the directory at tests/<name>/ in the repo contains
the full Rabbit-in-a-Hat fixture.