Rhombus Metaprogramming Reference
See Rhombus Reference for information on the base Rhombus language, including basic metaprogramming support in the form of syntax objects and the macro form. This document defines the rest of Rhombus’s metaprogramming facilities.
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—