8.12

3 Syntax Objects and Macros🔗ℹ

Rhombus’s use of shrubbery notation makes it possible to provide convenient forms for matching and constructing syntactic terms. A syntax object encapsulates shrubbery structure—enriched with binding information and metadata such as source locations—without requiring that the shrubbery parses as an existing form. Pieces of a syntax object can be extracted via pattern matching and then spliced into new syntax-object constructions, which is the main work of defining syntactic forms through macros.

    3.1 Syntax Objects

    3.2 Expression Macros

    3.3 Definition and Declaration Macros

    3.4 Binding and Annotation Macros

    3.5 Annotations versus Binding Patterns

    3.6 Syntax Patterns and Classes