Created
May 24, 2010 18:12
-
-
Save cametan001/412214 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 do!* | |
(syntax-rules () | |
((_ ((var init step) | |
...) | |
(pred e ...) | |
body ...) | |
(let ((tag #f)) | |
(let* ((var init) ...) | |
(call/cc | |
(lambda (cc) | |
(set! tag cc))) | |
(call/cc | |
(lambda (return) | |
(and pred (return (begin e ...))) | |
body ... | |
(set! var step) | |
... | |
(tag '())))))))) |
This file contains hidden or 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 multiple-value-bind | |
(syntax-rules () | |
((_ (var ...) values-form form ...) | |
(call-with-values (lambda () values-form) | |
(lambda (var ...) form ...))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment