Goals of my lectures A way of adding types DSL-making “tools” Another DSL example
Goals of my lectures A way of adding types DSL-making “tools” Another DSL example Last time: type-of, type=?, assign-type define-type check-type #%datum add1 This time: #%app lambda Type constructors Type checking types
Goals of my lectures A way of adding types DSL-making “tools” Another DSL example Last time (basic): syntax-parse Syntax objects Syntax properties Interposition: #%app, #%datum Today (deep end): Phasing Pattern expanders Id macros Syntax classes Definition contexts
Goals of my lectures A way of adding types DSL-making “tools” Another DSL example Next time
Id macros are tricky! Racket macro expansion algorithm: For syntax object #’(x y z): If x is macro Pass #’(x y z) to syntax transformer registered as macro x Else Pass #’(#%app x y z) to #%app macro Ambiguity: what if x = id macro that expands to add1 We want to invoke x macro on just x, but algorithm doesn’t do that