diff --git a/collects/racket/contract/private/provide.rkt b/collects/racket/contract/private/provide.rkt index b6280bc9ed..29716f90f8 100644 --- a/collects/racket/contract/private/provide.rkt +++ b/collects/racket/contract/private/provide.rkt @@ -799,8 +799,8 @@ (define-syntax (provide/contract stx) (define s-l-c (syntax-local-context)) (case s-l-c - [(module-begin) ;; the case under discussion - #`(begin (define-values () (values)) ;; force us into the 'module' local context + [(module-begin) + #`(begin ;; force us into the 'module' local context #,stx)] [(module) ;; the good case (true-provide/contract stx #f 'provide/contract)] diff --git a/collects/racket/contract/region.rkt b/collects/racket/contract/region.rkt index 15532dfbdb..85dcf52cb0 100644 --- a/collects/racket/contract/region.rkt +++ b/collects/racket/contract/region.rkt @@ -46,10 +46,18 @@ ; ; ; +(define-syntax (define/contract stx) + (define s-l-c (syntax-local-context)) + (case s-l-c + [(module-begin) + #`(begin #,stx)] + [else + (define/contract-expander stx)])) + ;; (define/contract id contract expr) ;; defines `id' with `contract'; initially binding ;; it to the result of `expr'. These variables may not be set!'d. -(define-syntax (define/contract define-stx) +(define-for-syntax (define/contract-expander define-stx) (define-splicing-syntax-class fv-clause #:description "a free variable clause" #:attributes ([var 1] [ctc 1])