Created
March 21, 2014 19:28
-
-
Save zeptometer/9694244 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-syntax let-values | |
(syntax-rules () | |
((let-values (binding ...) body0 body1 ...) | |
(let-values "bind" | |
(binding ...) () (begin body0 body1 ...))) | |
((let-values "bind" () tmps body) | |
(let tmps body)) | |
((let-values "bind" ((b0 e0) | |
binding ...) tmps body) | |
(let-values "mktmp" b0 e0 () | |
(binding ...) tmps body)) | |
((let-values "mktmp" () e0 args | |
bindings tmps body) | |
(call-with-values | |
(lambda () e0) | |
(lambda args | |
(let-values "bind" | |
bindings tmps body)))) | |
((let-values "mktmp" (a . b) e0 (arg ...) | |
bindings (tmp ...) body) | |
(let-values "mktmp" b e0 (arg ... x) | |
bindings (tmp ... (a x)) body)) | |
((let-values "mktmp" a e0 (arg ...) | |
bindings (tmp ...) body) | |
(call-with-values | |
(lambda () e0) | |
(lambda (arg ... . x) | |
(let-values "bind" | |
bindings (tmp ... (a x)) body)))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment