fix r6rs let[rec]-syntax for expression positions
svn: r8982
This commit is contained in:
parent
7f3c8510de
commit
788adace20
|
@ -478,6 +478,14 @@
|
|||
(define-for-syntax (do-let-syntax stx rec?)
|
||||
(syntax-case stx ()
|
||||
[(_ ([id expr] ...) body ...)
|
||||
(if (eq? 'expression (syntax-local-context))
|
||||
(with-syntax ([let-stx (if rec?
|
||||
#'letrec-syntax
|
||||
#'let-syntax)])
|
||||
(syntax/loc stx
|
||||
(let-stx ([id (wrap-as-needed expr)] ...)
|
||||
(#%expression body)
|
||||
...)))
|
||||
(let ([sli (if (list? (syntax-local-context))
|
||||
syntax-local-introduce
|
||||
values)])
|
||||
|
@ -505,7 +513,7 @@
|
|||
#'(begin
|
||||
(define-syntax id (wrap-as-needed expr))
|
||||
...
|
||||
body ...)))))]))
|
||||
body ...))))))]))
|
||||
|
||||
(define-syntax (r6rs:let-syntax stx)
|
||||
(do-let-syntax stx #f))
|
||||
|
|
|
@ -88,6 +88,17 @@
|
|||
(dolet a))
|
||||
7)
|
||||
|
||||
;; check that it's ok as an expression:
|
||||
(test 6
|
||||
(let-syntax ([foo
|
||||
(syntax-rules ()
|
||||
[(_)
|
||||
(let-syntax ([bar
|
||||
(syntax-rules ()
|
||||
[(_) 5])])
|
||||
(bar))])])
|
||||
(+ 1 (foo))))
|
||||
|
||||
#;
|
||||
(test/exn (let ([else #f])
|
||||
(case 0 [else (write "oops")]))
|
||||
|
|
Loading…
Reference in New Issue
Block a user