add shortcut to expand R6RS letrec' of procedures to Racket letrec'

This commit is contained in:
Matthew Flatt 2011-05-25 03:09:26 -06:00
parent c7d2f13dd0
commit 8f0921a9bd

View File

@ -457,8 +457,12 @@
;; letrec
;; Need bindings like R5RS, but int-def body like Racket
(define-syntax-rule (r6rs:letrec bindings . body)
(r5rs:letrec bindings (let () (#%stratified-body . body))))
(define-syntax (r6rs:letrec stx)
(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)
(letrec bindings (#%stratified-body . body)))