diff --git a/collects/scheme/splicing.ss b/collects/scheme/splicing.ss index d22f905a58..9988378d73 100644 --- a/collects/scheme/splicing.ss +++ b/collects/scheme/splicing.ss @@ -197,7 +197,12 @@ (syntax-case body (quote) [(ls _ _ (quote body)) (let ([body #'body]) - (syntax-case body (begin define-values define-syntaxes define-for-syntaxes) + (syntax-case body ( begin + define-values + define-syntaxes + define-for-syntaxes + #%require + #%provide ) [(begin expr ...) (syntax/loc body (begin (expand-ssp-body (sp-id ...) (temp-id ...) expr) ...))] @@ -208,6 +213,8 @@ rhs)))] [(define-syntaxes . _) body] [(define-for-syntaxes . _) body] + [(#%require . _) body] + [(#%provide . _) body] [expr (syntax/loc body (letrec-syntaxes ([(sp-id) (syntax-local-value (quote-syntax temp-id))] ...) expr))]))]))])) diff --git a/collects/scribblings/reference/splicing.scrbl b/collects/scribblings/reference/splicing.scrbl index f6f2e28887..24ada5054b 100644 --- a/collects/scribblings/reference/splicing.scrbl +++ b/collects/scribblings/reference/splicing.scrbl @@ -59,16 +59,17 @@ once during compilation as in @scheme[let-syntax], etc. @defidform[splicing-syntax-parameterize]{ -Like @scheme[syntax-parameterize], except that in a definition -context, the body forms are spliced into the enclosing definition -context (in the same as as for @scheme[begin]), as long as the body -forms are valid in an internal-definition context. In particular, -@scheme[require] and @scheme[provide] forms cannot appear in the body -of @scheme[splicing-syntax-parameterize], even if -@scheme[splicing-syntax-parameterize] is used in a @scheme[module] -body. In a definition context, the body of +Like @scheme[syntax-parameterize], except that in a definition context, the body +forms are spliced into the enclosing definition context (in the same way as for +@scheme[begin]). In a definition context, the body of @scheme[splicing-syntax-parameterize] can be empty. +Note that @tech{require transformers} and @tech{provide transformers} are not +affected by syntax parameterization. While all uses of @scheme[require] and +@scheme[provide] will be spliced into the enclosing context, derived import or +export specifications will expand as if they had not been inside of the +@scheme[splicing-syntax-parameterize]. + @examples[ #:eval splice-eval (define-syntax-parameter place (lambda (stx) #'"Kansas"))