From 3bc9fc3173d87a2293bdc9e83c9bc0520f36cc30 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Sat, 4 Feb 2017 15:34:05 -0800 Subject: [PATCH] update docs --- beautiful-racket-lib/br/scribblings/br.scrbl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/beautiful-racket-lib/br/scribblings/br.scrbl b/beautiful-racket-lib/br/scribblings/br.scrbl index cccd314..e12449a 100644 --- a/beautiful-racket-lib/br/scribblings/br.scrbl +++ b/beautiful-racket-lib/br/scribblings/br.scrbl @@ -258,7 +258,7 @@ The error is cleared when the argument is capitalized, thus making it a wildcard (good-squarer +10i) ] -You can use the special variable @racketfont{caller-stx} — available only within the body of @racket[define-macro] — to access the original input argument to the macro. +You can use the special variable @racket[caller-stx] — available only within the body of @racket[define-macro] — to access the original input argument to the macro. @;{todo: fix this example. complains that caller-stx is unbound} @examples[#:eval my-eval @@ -371,7 +371,7 @@ As with @racket[define-macro], wildcards in each syntax pattern must be @tt{CAPI } -@defthing[caller-stx]{ +@defthing[caller-stx syntax?]{ A special variable only available inside the body of @racket[define-macro] or @racket[define-macro-cases]. It contains the whole original syntax object that was passed to the macro. } @@ -449,11 +449,14 @@ Bind pattern variables within each @racket[stx-pattern] by matching the pattern @defproc[ (prefix-id - [prefix ... string?] - [id-or-ids (or/c identifier? (listof identifier?))]) + [prefix string?] ... + [id-or-ids (or/c identifier? (listof identifier?))] + [#:source loc-stx syntax? #f]) (or/c identifier? (listof identifier?))]{ Create a new identifier within the lexical context of @racket[id-or-ids] with the same name, but prefixed with @racket[prefix]. If there's more than one @racket[prefix], they are concatenated. If @racket[id-or-ids] is a single identifier, then the function returns a single identifier. Likewise, if it's a list of identifiers, the function returns a list of identifiers, all prefixed. +The optional @racket[loc-stx] argument supplies the source location for the resulting identifier (or identifiers). + @examples[#:eval my-eval (define-macro ($-define ID VAL) (with-pattern ([PREFIXED-ID (prefix-id '$ #'ID)])