Composable and compilable macros:
Matthew Flatt · ACM SIGPLAN International Conference on Functional Programming (ICFP) · 2002
Many macro systems, especially for Lisp and Scheme, allow macro transformers to perform general computation. Moreover, the language for implementing compile-time macro transformers is usually the same as the language for implementing run-time functions. As a side effect of this sharing, implementations tend to allow the mingling of compile-time values and run-time values, as well as values from separate compilations. Such mingling breaks programming tools that must parse code without executing it. Macro implementors avoid harmful mingling by obeying certain macro-definition protocols and by inserting phase-distinguishing annotations into the code. However, the annotations are fragile, the protocols are not enforced, and programmers can only reason about the result in terms of the compiler's implementation. MzScheme---the language of the PLT Scheme tool suite---addresses the problem through a macro system that separates compilation without sacrificing the expressiveness of macros.
Cited by 126 works. doi:10.1145/581478.581486
Authors
References
- Common LISP. The language
- The Programming Language LISP: Its Operation and Applications
- The Revised Report on SCHEME: A Dialect of LISP.
- Revised5 Report on the Algorithmic Language Scheme
- Revised 5 report on the algorithmic language scheme
- Hygienic macro expansion
- Units
- Syntactic abstraction in scheme
- Essentials of programming languages
- Macros that work