diff --git a/pkgs/racket-doc/scribblings/reference/splicing.scrbl b/pkgs/racket-doc/scribblings/reference/splicing.scrbl index 1d24b111af..1b62004525 100644 --- a/pkgs/racket-doc/scribblings/reference/splicing.scrbl +++ b/pkgs/racket-doc/scribblings/reference/splicing.scrbl @@ -73,6 +73,11 @@ affected by syntax parameterization. While all uses of @racket[require] and export specifications will expand as if they had not been inside of the @racket[splicing-syntax-parameterize]. +Additionally, @tech{submodules} defined with @racket[module*] that specify +@racket[#f] in place of a @tech{module path} @emph{are} affected by syntax +parameterization, but other submodules (those defined with @racket[module] or +@racket[module*] with a @tech{module path}) are @emph{not}. + @examples[ #:eval splice-eval (define-syntax-parameter place (lambda (stx) #'"Kansas")) @@ -81,7 +86,12 @@ export specifications will expand as if they had not been inside of the (splicing-syntax-parameterize ([place (lambda (stx) #'"Oz")]) (define here (where))) here -]} +] + +@history[ + #:changed "6.11.0.1" + @elem{Modified to syntax parameterize @racket[module*] submodules that + specify @racket[#f] in place of a @tech{module path}.}]} @; ---------------------------------------------------------------------- diff --git a/pkgs/racket-test-core/tests/racket/stxparam.rktl b/pkgs/racket-test-core/tests/racket/stxparam.rktl index 9d19b6e799..8d0797ace9 100644 --- a/pkgs/racket-test-core/tests/racket/stxparam.rktl +++ b/pkgs/racket-test-core/tests/racket/stxparam.rktl @@ -74,6 +74,12 @@ (lambda (stx) #`(quote #,v))))) (m))) + + ; make sure splicing-syntax-parameterize works with (module* _ #f ....) + (splicing-syntax-parameterize ([sp 'sub-submod]) + (module* sp-submod #f + (provide b) + (m b))) (provide x y z w f g)) @@ -83,6 +89,7 @@ (test 'sub2 dynamic-require ''check-splicing-stxparam-1 'w) (test 'nested values ((dynamic-require ''check-splicing-stxparam-1 'f))) (test 'also-nested values ((dynamic-require ''check-splicing-stxparam-1 'g))) +(test 'sub-submod dynamic-require '(submod 'check-splicing-stxparam-1 sp-submod) 'b) (module check-splicing-stxparam-et racket/base (require (for-syntax racket/base) diff --git a/racket/collects/racket/splicing.rkt b/racket/collects/racket/splicing.rkt index 40c99ffb27..7b404f05b6 100644 --- a/racket/collects/racket/splicing.rkt +++ b/racket/collects/racket/splicing.rkt @@ -343,6 +343,9 @@ (syntax/loc/props body (begin-for-syntax (wrap-param-et e (orig-id ...) (temp-id ...)) ...))] [(module . _) body] + [(module* n #f form ...) + (syntax/loc/props body + (module* n #f (expand-ssp-body (sp-id ...) (temp-id ...) (orig-id ...) form) ...))] [(module* . _) body] [(#%require . _) body] [(#%provide . _) body] @@ -408,6 +411,9 @@ (syntax/loc/props e (define-values ids (wrap-param-et rhs (orig-id ...) (temp-id ...))))] [(module . _) e] + [(module* n #f form ...) + (syntax/loc/props e + (module* n #f (wrap-param-et form (orig-id ...) (temp-id ...)) ...))] [(module* . _) e] [(#%require . _) e] [(#%provide . _) e]