4 ms·
The name `macro-expand` is from Common Lisp. Scheme R5RS, R6RS and R7RS all have macro systems. In R5RS has a pattern/template based system (syntax-rules). In
by soegaard 1y ago
The name `macro-expand` is from Common Lisp.
Scheme R5RS, R6RS and R7RS all have macro systems.
In R5RS has a pattern/template based system (syntax-rules).
In R6RS the system has both patterns, templates and procedural macros.
The most modern system is Racket though. See `syntax-parse`.
- ashton314 1y ago+1 for `syntax-parse`—it's thoroughly the most powerful (and yet somehow also the most ergonomic) way to write macros in any language thus far. Wait, r6rs has proc macros? Where is that in the spec? I've only seen the `syntax-rules` bit.
- soegaard 1y ago/u/ashton314 Look for `define-syntax`. https://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_idx_358 https://www.r6rs.org/final/html/r6rs/r6rs-Z-H-14.html#node_i... https://www.r6rs.org/final/html/r6rs/r6rs-Z-H-13.html https://www.r6rs.org/final/html/r6rs/r6rs-Z-H-13.html