Syntactic extensions in the programming language LISP
Syntactic extensions in the programming language LISP
Reasoning about programs in continuation-passing style.
LFP '92 Proceedings of the 1992 ACM conference on LISP and functional programming
LFP '86 Proceedings of the 1986 ACM conference on LISP and functional programming
Macros as multi-stage computations: type-safe, generative, binding macros in MacroML
Proceedings of the sixth ACM SIGPLAN international conference on Functional programming
Revised Report on the Algorithmic Language Scheme
Higher-Order and Symbolic Computation
A Universal Scripting Framework or Lambda: The Ultimate "Little Language"
ASIAN '96 Proceedings of the Second Asian Computing Science Conference on Concurrency and Parallelism, Programming, Networking, and Security
ACM SIGPLAN Lisp Pointers
A new one-pass transformation into monadic normal form
CC'03 Proceedings of the 12th international conference on Compiler construction
SugarJ: library-based syntactic language extensibility
Proceedings of the 2011 ACM international conference on Object oriented programming systems languages and applications
Hi-index | 0.00 |
Macros are often regarded as a sort of black magic: highly useful yet abstruse. The present paper aims to make macro programming more like a craft. Using R5RS Scheme macros as an example, we develop and present a general practical methodology of building complex macros systematically, by combining simpler components by functional composition or higher-order operatorsMacro programming is complex because the systematic approach does not apply to many macros. We show that macros and other headfirst normal-order re-writing systems generally lack functional composition. However, macros written in a continuation-passing style (CPS) always compose. Making CPS macros practical still requires an encoding for macro-continuations. We have found this missing piece, with an insight for anonymous macro-level abstractions.In the specific case of R5RS macros, this paper presents a stronger result: developing R5RS macros by a translation from the corresponding Scheme procedures. We demonstrate the practical use of the technique by elaborating a real-world example.