From ccac23d648064a5f6ecf370ba9f8075d1bc86594 Mon Sep 17 00:00:00 2001 From: Jon Rafkind Date: Mon, 28 Jun 2010 14:33:00 -0600 Subject: [PATCH] show example of nested syntax matching --- collects/scribblings/reference/stx-patterns.scrbl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/collects/scribblings/reference/stx-patterns.scrbl b/collects/scribblings/reference/stx-patterns.scrbl index 47258e99ff..6bbc0372a6 100644 --- a/collects/scribblings/reference/stx-patterns.scrbl +++ b/collects/scribblings/reference/stx-patterns.scrbl @@ -168,6 +168,13 @@ A syntax object matches a @scheme[pattern] as follows: (syntax-case #'(ops 1 2 3 => +) (=>) [(_ x ... => op) #'(op x ...)]) + +(syntax-case #'(let ([x 5] [y 9] [z 12]) + (+ x y z)) + (let) + [(let ([var expr] ...) body ...) + (list #'(var ...) + #'(expr ...))]) ]} @defform[(syntax-case* stx-expr (literal-id ...) id-compare-expr