Syntax Rules: synrule.ss

Next: Threads: thread.ss Up: MzLib Libraries Previous: Strings: string.ss

## Syntax Rules: `synrule.ss`

Files: `synrule.ss`

This library provides `define-syntax`, implementing the `syntax-rules` high-level macro system from R5RS. This implementation of syntax rules can only be used with the following syntactic forms: `quote` `if` `begin` `set!` `define` `lambda` `letrec` `let` `let*` `do` `case` `cond`. If any other form is used in the macro definition or macro application, the results are unpredictable.

Macros definitions using `define-syntax` are translated into equivalent `define-macro` expressions; however, the translated macros contain the following free variables (the macro definitions contain these expressions, not the expansions of applied macros):

- `-:sr:tag-generic`
- `-:sr:hyg-flatten`
- `-:sr:matches-pattern?`
- `-:sr:get-bindings`
- `-:sr:expand-pattern`

These variables are defined by the `synrule.ss` library as keywords.

This library was contributed by Shriram Krishnamurthi, working from Dorai Sitaram's implementation.