[plt-scheme] Struggling with macro...
Robert Nikander wrote:
> (let* ([sections (syntax->list #'(sexps ...))]
> [adds (map (λ (section)
> (syntax-case section (variables thingies)
> ((variables (name value) ...)
> #'(begin (add-variable-to-mc mc 'name
> value) ...))
> ((thingies expr ...)
> #'(begin (add-thingy-to-mc mc expr) ...))))
> sections)])
I should have used syntax-rules, for simplicity...
[adds (map (syntax-rules (variables thingies)
((variables (name value) ...)
(begin (add-variable-to-mc mc 'name value) ...))
((thingies expr ...)
(begin (add-thingy-to-mc mc expr) ...)))
sections)])