|Playlist||schedule page slides as PDF|
Although macro expansion is built at its core functions that consume and produce S-expression representations of syntax, pattern-based macros can be far more readable and maintainable.
Macro 2 — define-syntax-rule (2:25)
Explanation of the define-syntax-rule form for defining pattern-based macros.
Macro 3 — syntax-rules (2:53)
Explanation of the syntax-rules form for defining pattern-based macros (with define-syntax).
Macro 4 — ellipses (3:39)
Using ellipses (...) in patterns and templates.
Macro 5 — hygiene (5:39)
Hygiene means lexical scope at the macro level, and it is a property of macros or macro systems. Later, we’ll look at how hygiene works.
Macro 6 — identifier macros (3:04)
OPTIONAL Explanation of the syntax-id-rules form for defining pattern-based macros (with define-syntax).
OPTIONAL Macro-generating macros and escaping ellipses.
OPTIONAL An extended example of using pattern-based macros to implement a language construct. See cbr.rkt.
Macro 9 — modules (3:38)
OPTIONAL How macros and modules interact, and the provide sublanguage for describing module exports.