CSE 341 Autumn 2012 - Racket Macros

1 · Shane Mulligan · Oct. 31, 2019, 4 p.m.
To oversimplify, a macro is just a rule for rewriting programs as a prepass to evaluation. So it’s very syntactic. The “level” at which macros are defined affects their usefulness. No macro system is sublexical Sublexical Replace car with hd would turn cart into hdt. A macro-expander must know how to break programs into tokens. • “Pre-parsing” e.g.: Replace add(x,y) with x + y (where x and y stand for expressions) would turn add(x,y) * z into x + y * z....