7 Meta and Macros Reference
import: rhombus/meta | package: rhombus-prototype |
#lang rhombus/and_meta | package: rhombus-prototype |
Simple pattern-based expression macros can be written using macro without importing any additional libraries besides rhombus, but implementing others forms of macros requires using the rhombus/meta module (usually with no prefix).
The rhombus/meta module provides bindings like defn.macro, expr.macro, and bind.macro. It it also re-exports most of rhombus as meta for use in compile-time expressions, but it omits bindings from rhombus that bridge to meta contexts: meta, macro, binding, etc. Explicitly import rhombus as meta to access the omitted bindings.
The rhombus/and_meta module provides all of the
bindings from both rhombus and
rhombus/meta. It’s intended for use as a language—