From 243e60747777d4c24c4909437baf4ee0d50be2f7 Mon Sep 17 00:00:00 2001 From: Stephen Chang Date: Fri, 13 Jun 2014 14:43:29 -0400 Subject: [PATCH] add note in syntax-parse docs about #:with and #:declare interaction --- .../syntax/scribblings/parse/stxclasses.scrbl | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pkgs/racket-pkgs/racket-doc/syntax/scribblings/parse/stxclasses.scrbl b/pkgs/racket-pkgs/racket-doc/syntax/scribblings/parse/stxclasses.scrbl index f7094bd25e..4d932754a3 100644 --- a/pkgs/racket-pkgs/racket-doc/syntax/scribblings/parse/stxclasses.scrbl +++ b/pkgs/racket-pkgs/racket-doc/syntax/scribblings/parse/stxclasses.scrbl @@ -198,6 +198,28 @@ syntax classes, which cannot be expressed using the ``colon'' notation. The @racket[arg]s are evaluated in the scope where the @racket[pvar-id] occurs in the pattern. Keyword arguments are supported, using the same syntax as in @racket[#%app]. + +If a @racket[#:with] directive appears between the main pattern (e.g., in a +@racket[syntax-parse] or @racket[define-syntax-class] clause) and a +@racket[#:declare], then only pattern variables from the @racket[#:with] +pattern may be declared. + +@myexamples[ +(syntax-parse #'P + [x + #:declare x id + #'x]) +(syntax-parse #'L + [x + #:with y #'x + #:declare x id + #'x]) +(syntax-parse #'T + [x + #:with y #'x + #:declare y id + #'x]) +] } @specsubform[(code:line #:with syntax-pattern stx-expr)]{