Pre-R6RS Portable syntax-case

R. Kent Dybvig, Oscar Waddell

The syntax-case macro system implements the restricted high-level syntax-rules macros of the Revised5 Report as well as the equally high-level but general-purpose syntax-case macros. It also supports a compatible module system that allows import and export of macro bindings as well as bindings for variables and modules.

The system is documented in Section 3.1 and Chapter 8 of The Scheme Programming Language, third edition and in Chapter 9 of the Chez Scheme Version 7 User's Guide. The former has more introductory material and examples, while the latter documents some aspects of the system not covered by the former.

Aspects of the system and its implementation are described in Syntactic abstraction in Scheme and Extending the Scope of Syntactic Abstraction Additional examples of its use are given in Writing hygienic macros in Scheme with syntax-case.

The portable system is designed to be adaptable with minimal effort to any Revised5 Report implementation of Scheme, with the provision of a small set of implementation-dependent hooks to install the expander. Included with the portable expander are definitions of each of the syntactic forms supported by the Revised5 Report. Along with a reader, the system forms a complete front-end for Scheme. If the reader and evaluator support source annotations (e.g., file and line number information), these are handled as well to provide source-object correlation.

The portable syntax-case implementation consists of one file, psyntax.ss. The file psyntax.pp is an expanded version of the file that may be used for bootstrapping the system. See the porting notes in psyntax.ss

Please let us know if you successfully port this code to a new Scheme implementation, and also please allow us to include the hooks you develop in doing the port in this directory for use by others.

Please also contact us if you have difficulty porting to a new Scheme implementation or if you discover that the implementation depends on nonportable features of Chez Scheme in some undocumented way.

Release Notes

Version numbers refer to the version of Chez Scheme from which the portable version was extracted.

Version 7.3 (2/26/2007)

[psyntax.ss, psyntax.pp]

Version 7.1 (8/1/2006)

[psyntax.ss, psyntax.pp]

Version 7.0 (9/2/2005)

[psyntax.ss, psyntax.pp]

Version 6.9c (9/2/2004)

[psyntax.ss, psyntax.pp]

Version 6.9a (5/13/2003)

[psyntax.ss, psyntax.pp]

Version 6.9 (7/12/2002)

[psyntax.ss, psyntax.pp]

Version 6.8 (2/6/2002)

[psyntax.ss, psyntax.pp]

Version 6.3 (8/30/2000)

[psyntax.ss, psyntax.pp]