add shortcut to expand R6RS letrec' of procedures to Racket
letrec'
This commit is contained in:
parent
c7d2f13dd0
commit
8f0921a9bd
|
@ -457,8 +457,12 @@
|
||||||
;; letrec
|
;; letrec
|
||||||
;; Need bindings like R5RS, but int-def body like Racket
|
;; Need bindings like R5RS, but int-def body like Racket
|
||||||
|
|
||||||
(define-syntax-rule (r6rs:letrec bindings . body)
|
(define-syntax (r6rs:letrec stx)
|
||||||
(r5rs:letrec bindings (let () (#%stratified-body . body))))
|
(syntax-case stx (r6rs:lambda)
|
||||||
|
[(_ ([id (r6rs:lambda . rest)] ...) . body)
|
||||||
|
#'(letrec ([id (r6rs:lambda . rest)] ...) (let () (#%stratified-body . body)))]
|
||||||
|
[(_ bindings . body)
|
||||||
|
#'(r5rs:letrec bindings (let () (#%stratified-body . body)))]))
|
||||||
|
|
||||||
(define-syntax-rule (r6rs:letrec* bindings . body)
|
(define-syntax-rule (r6rs:letrec* bindings . body)
|
||||||
(letrec bindings (#%stratified-body . body)))
|
(letrec bindings (#%stratified-body . body)))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user