1 Parsing and Specifying Syntax🔗ℹ

The syntax/parse library provides a framework for writing macros and processing syntax. The library provides a powerful language of syntax patterns, used by the pattern-matching form syntax-parse and the specification form define-syntax-class. Macros that use syntax-parse automatically generate error messages based on descriptions and messages embedded in the macro’s syntax patterns.
 (require syntax/parse) package: base

    1.1 Introduction

    1.2 Examples

      1.2.1 Phases and Reusable Syntax Classes

      1.2.2 Optional Keyword Arguments

        1.2.2.1 Optional Arguments with ~?

        1.2.2.2 Optional Arguments with define-splicing-syntax-class

      1.2.3 Variants with Uniform Meanings

      1.2.4 Variants with Varied Meanings

        1.2.4.1 Syntactic Normalization

        1.2.4.2 Non-syntax-valued Attributes

      1.2.5 More Keyword Arguments

      1.2.6 Contracts on Macro Sub-expressions

    1.3 Parsing Syntax

    1.4 Specifying Syntax with Syntax Classes

      1.4.1 Pattern Directives

      1.4.2 Pattern Variables and Attributes

        1.4.2.1 Attributes and datum

    1.5 Syntax Patterns

      1.5.1 Single-term Patterns

      1.5.2 Head Patterns

      1.5.3 Ellipsis-head Patterns

      1.5.4 Action Patterns

      1.5.5 Pattern Expanders

    1.6 Defining Simple Macros

    1.7 Literal Sets and Conventions

    1.8 Library Syntax Classes and Literal Sets

      1.8.1 Syntax Classes

      1.8.2 Literal Sets

      1.8.3 Function Headers

    1.9 Unwindable State

    1.10 Configuring Error Reporting

    1.11 Debugging and Inspection Tools

    1.12 Experimental

      1.12.1 Contracts for Macro Sub-expressions

      1.12.2 Contracts for Syntax Classes

      1.12.3 Reflection

      1.12.4 Procedural Splicing Syntax Classes

      1.12.5 Ellipsis-head Alternative Sets

      1.12.6 Syntax Class Specialization

      1.12.7 Syntax Templates

    1.13 Minimal Library