Reputation: 1665
I would like to rewrite this:
(define-syntax match-rewriter
(syntax-rules ()
((_ (patt body) ...)
(λ (x) (match x (patt body) ... (_ x))))))
using (define-syntax-rule pattern template) but I can't seem to get the syntax right. Any advice is appreciated.
Thanks.
Upvotes: 1
Views: 342
Reputation: 30969
Try:
(define-syntax-rule (match-rewriter (patt body) ...)
(lambda (x) (match x (patt body) ... (_ x))))
Upvotes: 1