Abstract
Racket provides for loops with macro-extensible sequence expressions. Sequence macros offer better performance than dynamic sequence implementations, but they are complicated to define and Racket offers little support for creating new sequence macros by combining existing ones. In this paper, we develop such support in the form of sequence combinator macros and a general comprehension form. These utilities are implemented by manipulating compile-time records that contain binders and expressions; the binding relationships between the components are not trivial. We discuss how to diagnose and solve type and scoping problems in our implementation.
Original language | English |
---|---|
Title of host publication | Composable Sequence Macros for Fast Iteration |
Pages | 59-71 |
Number of pages | 13 |
Publication status | Published - 1 Dec 2022 |
Externally published | Yes |
Keywords
- macros
- metaprogramming
- syntactic abstraction
- extensible languages
- sequences
Fields of Science and Technology Classification 2012
- 102 Computer Sciences