8.12

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—an alternative to starting with rhombus and importing rhombus/meta.

    7.1 Meta Definitions and Expressions

    7.2 Spaces

    7.3 Namespace Space

    7.4 Definition Macros

    7.5 Declaration Macros

    7.6 Expression Macros

    7.7 Assignment Macros

    7.8 Binding Macros

    7.9 Annotation Macros

    7.10 Static Information

    7.11 Dot Providers

    7.12 Repetition Macros

    7.13 Form-Specific Macros

      7.13.1 Import Macros

      7.13.2 Export Macros

      7.13.3 For Clause Macros

      7.13.4 Sequence Macros

      7.13.5 Reducer Macros

      7.13.6 Class and Interface Clause Macros

      7.13.7 Unquote Binding Macros

      7.13.8 Syntax Class Clause Macros

      7.13.9 Syntax Pattern Clause Macros

      7.13.10 Entry Point Macros

      7.13.11 Map Configurations

    7.14 Syntax Objects in Macros

    7.15 Syntax Parameters