fix a broken pattern-expander example (#2197)

pattern expanders shouldn't use `syntax-protect` on their results, and so they shouldn't use `syntax-rules`
This commit is contained in:
yjqww6 2018-07-29 00:18:40 +08:00 committed by Alex Knauth
parent a447b5bf6b
commit 759c71e158

View File

@ -1151,9 +1151,10 @@ Returns a @tech{pattern expander} that uses @racket[proc] to transform the patte
@examples[#:eval the-eval
(define-syntax ~maybe
(pattern-expander
(syntax-rules ()
(lambda (stx)
(syntax-case stx ()
[(~maybe pat ...)
(~optional (~seq pat ...))])))
#'(~optional (~seq pat ...))]))))
]}
@defthing[prop:pattern-expander (struct-type-property/c (-> pattern-expander? (-> syntax? syntax?)))]{