The idea of match-expander is that you can expand the match form to handle new templates for your own design templates.
So here is a (somewhat meaningless) example that defines the form of matching "aba" that matches the patterns of one thing, followed by another thing, followed by the first, and then "aba"):
#lang racket (define-match-expander aba (lambda stx (syntax-case stx () [((_ ab))
The second form allows you to add a separate extension that will be used outside the match patterns, for example:
#lang racket (define-match-expander aba (lambda stx (syntax-case stx () [((_ ab))
Caution: add a couple of parsers around the template? Not sure, sorry.
John clements
source share