Sciweavers

GPCE
2004
Springer

Taming Macros

13 years 9 months ago
Taming Macros
Scheme includes a simple yet powerful macro mechanism. Using macros, programmers can easily extend the language with new kinds of expressions and definitions, thus abstracting over recurring syntactic patterns. As with every other powerful language mechanism, programmers can also easily misuse macros and, to this day, broken macro definitions or macro uses pose complex debugging problems to programmers at all levels of experience. In this paper, we present a type system for taming Scheme-like macros. Specifically, we formulate a small model that captures the essential properties of Scheme-style macros. For this model, we formulate a novel type system to eliminate some of these problems, prove its soundness, and validate its pragmatic usefulness. 1 The Power of Macro Programming Over the past 20 years, the Scheme community has developed an expressive and easy-to-use standard macro system [1]. To introduce a new construct via a macro, a programmer simply writes down a rewriting rule c...
Ryan Culpepper, Matthias Felleisen
Added 01 Jul 2010
Updated 01 Jul 2010
Type Conference
Year 2004
Where GPCE
Authors Ryan Culpepper, Matthias Felleisen
Comments (0)