Playlist | schedule page slides as PDF |
Syntax 1 — eval (5:14)
This discussion of eval is a detour from our progression to macros, but it will be handy to have eval for the explanation in video 5.
Syntax 2 — namespace (2:59)
Since we’re talking about eval, let’s discuss when and how it’s reasonable to use eval.
Syntax 3 — macros as functions (3:56)
Moving beyond pattern-matching macros and motivating syntax objects.
Syntax 4 — syntax objects (3:27)
Creating and manipulating syntax objects.
Syntax 5 — lexical context (1:58)
The key difference between a syntax object and an S-expression is that a syntax object remembers its lexical context.
Syntax 6 — transformers (5:50)
Now that we have syntax objects, look again at how macros are functions that take and return syntax objects.
Syntax 7 — for-syntax imports (2:34)
Bindings imported into a module with require are available only at a specific phase. Use for-syntax to specify the phase where macro transformations run (as opposed to the later phase of running the enclosing program).
Syntax 8 — macro-generating macros (3:05)
Macro-generating macros and their interaction with phases and imports.
Syntax 9 — syntax-parse (4:12)
Using syntax-parse to get the benefits of pattern matching mixed with arbitrary computation.