Skip to content

Instantly share code, notes, and snippets.

@cametan001
Created May 24, 2010 18:12
Show Gist options
  • Save cametan001/412214 to your computer and use it in GitHub Desktop.
Save cametan001/412214 to your computer and use it in GitHub Desktop.
(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 '()))))))))
(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