Rhombus Metaprogramming Reference
This document defines Rhombus’s advanced metaprogramming facilities.
For a general overview of the language, see Rhombus.
For bindings in the main language, including basic metaprogramming support in the form of syntax objects and the macro form, see Rhombus Reference.
For more documentation, see Getting Started with Rhombus.
| import: rhombus/meta | package: rhombus-lib |
| #lang rhombus/and_meta | package: rhombus-lib |
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—