Skip to content

Instantly share code, notes, and snippets.

@ujihisa
Created April 6, 2012 05:35
Show Gist options
  • Save ujihisa/2317292 to your computer and use it in GitHub Desktop.
Save ujihisa/2317292 to your computer and use it in GitHub Desktop.
(define (while1 cond body)
(let ((c (call/cc (lambda (c) c))))
(if (cond)
(begin
(body)
(c c)))))
(define i 0)
(while1 (lambda () (< i 10))
(lambda ()
(print i)
(set! i (+ i 1))))
(print "end")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment