Writing Hygienic Macros in Scheme with Syntax-Case

R. Kent Dybvig · 1992

This report is dedicated to my good friend and colleague, Bob Hieb, who was killed along with his eleven-year old daughter Iva in a tragic car accident near their home on April 30, 1992. Bob and Iworked on the macro system described herein for several years, and many of the most important concepts and algorithms were developed by Bob, who had adopted it as his dissertation project. This report is intended not to justify the macro system, but to help potential users learn how to write macros using it. A companion report, \\Syntactic Abstraction in Scheme " [4], which was mostly written before Bob's death, does attempt to justify the macro system and to place it within the context of other work. The companion report also contains more detail on the algorithms used by our implementation of the macro system. A complete implementation of the macro system is available, and should run in any Scheme system with the provision of a few implementation-dependent \\hooks. " It can be obtained via \\anonymous ftp " from iuvax.cs.indiana.edu in the directory pub/scheme/syntax-case. Ifyou do not have ftp access, contact me and I will get the implementation to you somehow. The implementation is based on an earlier implementation by Bob and myself of the system described in an appendix to the \\Revised 4 Report on the Algorithmic Language Scheme " [2]. The present implementation, however, is more robust and signi cantly more e cient. Iwould like to thank Carl Bruggeman for his detailed and thoughtful comments on drafts of this report, and also for the use of his \\Scheme TeXer, " with which the examples contained within this report were formatted. I would like to thank David Eby, George Springer, and Dan Friedman as well for their helpful comments. 2

Read the paper · More papers on PaperTik