Skip to content

Macros

Status: stub

Full macro documentation is planned for Phase 2. Spec source: 13_MACROS.csl.

Sigil’s macro system operates at the AST level and is effect-aware: macros can inspect and constrain the effects of their arguments. This enables things like:

// assert! only accepts pure expressions — no !io allowed in the condition
assert!(magnitude(v) > 0.0); // ok: magnitude is pure
// assert!(read_file("x").len() > 0); // compile error: !io in assert!

Full macro documentation in Phase 2.