diff --git a/collects/mzlib/private/sigutil.rkt b/collects/mzlib/private/sigutil.rkt index 51199663ab..ff954ee1b3 100644 --- a/collects/mzlib/private/sigutil.rkt +++ b/collects/mzlib/private/sigutil.rkt @@ -602,6 +602,7 @@ (syntax-e (stx-car (stx-cdr p))))) (cdr (stx->list (let ([rn (car body)]) + ;; Use internal-definition-context-apply ?? (local-expand rn 'expression (list (stx-car rn)) diff --git a/collects/mzlib/unit200.rkt b/collects/mzlib/unit200.rkt index 68e2e60424..1106c77132 100644 --- a/collects/mzlib/unit200.rkt +++ b/collects/mzlib/unit200.rkt @@ -6,6 +6,7 @@ syntax/stx syntax/name syntax/context + unstable/syntax "list.rkt" "private/unitidmap.rkt") @@ -73,11 +74,8 @@ (begin ;; Treat imports as internal-defn names: (syntax-local-bind-syntaxes ids #f def-ctx) - (cdr (syntax->list - (local-expand #`(stop #,@ids) - 'expression - (list #'stop) - def-ctx)))) + (syntax->list + (internal-definition-context-apply def-ctx ids))) ids) ;; Let later checking report an error: ids))]) diff --git a/collects/racket/contract/regions.rkt b/collects/racket/contract/regions.rkt index a8b5e36e48..d4890ffa39 100644 --- a/collects/racket/contract/regions.rkt +++ b/collects/racket/contract/regions.rkt @@ -562,9 +562,7 @@ (values (syntax->list #'(fv.var ...)) (syntax->list #'(fv.ctc ...)))]) (define (add-context stx) - (let ([ctx-added-stx (local-expand #`(quote #,stx) ctx (list #'quote) intdef)]) - (syntax-case ctx-added-stx () - [(_ expr) #'expr]))) + (internal-definition-context-apply intdef stx)) (syntax-local-bind-syntaxes free-vars #f intdef) (internal-definition-context-seal intdef) (with-syntax ([blame-stx #''(region blame)] @@ -621,12 +619,7 @@ (values (syntax->list #'(ec.var ...)) (syntax->list #'(ec.ctc ...)))]) (define (add-context stx) - (let ([ctx-added-stx (local-expand #`(quote #,stx) - ctx - (list #'quote) - intdef)]) - (syntax-case ctx-added-stx () - [(_ expr) #'expr]))) + (internal-definition-context-apply intdef stx)) (syntax-local-bind-syntaxes protected #f intdef) (syntax-local-bind-syntaxes free-vars #f intdef) (internal-definition-context-seal intdef) diff --git a/collects/racket/splicing.rkt b/collects/racket/splicing.rkt index 4f09c3d382..24f9e156ce 100644 --- a/collects/racket/splicing.rkt +++ b/collects/racket/splicing.rkt @@ -1,6 +1,7 @@ #lang scheme/base (require (for-syntax scheme/base - syntax/kerncase) + syntax/kerncase + unstable/syntax) "stxparam.rkt" "private/stxparam.rkt" "private/local.rkt") @@ -56,12 +57,7 @@ (internal-definition-context-seal def-ctx) (let* ([add-context (lambda (expr) - (let ([q (local-expand #`(quote #,expr) - ctx - (list #'quote) - def-ctx)]) - (syntax-case q () - [(_ expr) #'expr])))]) + (internal-definition-context-apply def-ctx expr))]) (with-syntax ([((id ...) ...) (map (lambda (ids) (map add-context ids)) @@ -129,12 +125,7 @@ (internal-definition-context-seal def-ctx) (let* ([add-context (lambda (expr) - (let ([q (local-expand #`(quote #,expr) - ctx - (list #'quote) - def-ctx)]) - (syntax-case q () - [(_ expr) #'expr])))] + (internal-definition-context-apply def-ctx expr))] [add-context-to-idss (lambda (idss) (map add-context idss))])