parent
2f930dd6f3
commit
994a4d4a35
|
@ -1882,6 +1882,28 @@
|
|||
(module* a #f (bind-and-expand x x))
|
||||
(module* b #f (bind-and-expand x (list x))))
|
||||
|
||||
;; ----------------------------------------
|
||||
;; Make sure it's ok to produce an already-expanded
|
||||
;; expression in a definition context
|
||||
|
||||
(module macro-with-syntax-local-expand-expression-in-a-definition-context racket/base
|
||||
(require (for-syntax racket/base))
|
||||
|
||||
(define-syntax (m stx)
|
||||
(syntax-case stx ()
|
||||
[(_ e)
|
||||
(let ()
|
||||
(define-values (new-stx new-exp)
|
||||
(syntax-local-expand-expression #'e #t))
|
||||
new-exp)]))
|
||||
|
||||
(m 5)
|
||||
|
||||
(let ()
|
||||
(define whatever 10)
|
||||
(m (+ 1 2))
|
||||
'ok))
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
(report-errs)
|
||||
|
|
|
@ -209,6 +209,8 @@
|
|||
" extra bindings or scopes in the current context")
|
||||
(and (not (parsed? exp-s)) exp-s)))
|
||||
(cond
|
||||
[(expand-context-only-immediate? ctx)
|
||||
s]
|
||||
[(parsed? exp-s) exp-s]
|
||||
[else
|
||||
(define result-s (syntax-track-origin exp-s s))
|
||||
|
|
|
@ -38965,6 +38965,8 @@ static const char *startup_source =
|
|||
" \" extra bindings or scopes in the current context\")"
|
||||
"(if(not(parsed? exp-s_0)) exp-s_0 #f)))"
|
||||
"(void))"
|
||||
"(if(expand-context-only-immediate? ctx_18)"
|
||||
"(let-values() s_45)"
|
||||
"(if(parsed? exp-s_0)"
|
||||
"(let-values() exp-s_0)"
|
||||
"(let-values()"
|
||||
|
@ -38977,7 +38979,7 @@ static const char *startup_source =
|
|||
"(if(if(expand-context-to-parsed? ctx_18)(free-id-set-empty?(expand-context-stops ctx_18)) #f)"
|
||||
"(let-values(((result-s115_0) result-s_1)((ctx116_0) ctx_18))"
|
||||
"(expand7.1 #f #f #f #f result-s115_0 ctx116_0))"
|
||||
" result-s_1)))))))))))"
|
||||
" result-s_1))))))))))))"
|
||||
"(define-values"
|
||||
"(make-explicit)"
|
||||
"(lambda(ctx_19 sym_62 s_307 disarmed-s_2)"
|
||||
|
|
Loading…
Reference in New Issue
Block a user