fixes the "not used in definition context" error in define/contract
related to PR 12863, but doesn't solve the infinite loop problem
(cherry picked from commit 774e254f3c
)
This commit is contained in:
parent
51712648c3
commit
61e890ba15
|
@ -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)]
|
||||
|
|
|
@ -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])
|
||||
|
|
Loading…
Reference in New Issue
Block a user