-
-
Save agumonkey/529122d25949f3a75798f13313c427e2 to your computer and use it in GitHub Desktop.
nested continuations are tricky (see Alan Bawden)
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 (cc k) (call-with-current-continuation k)) | |
(display (format ">>> ~s\n" (- 10 (cc (lambda (k) (+ 1 (+ 2 (k 10)))))))) | |
(let ((k (cc (lambda (bind) (lambda (x) (+ 1 (cc (lambda (k) (bind k))))))))) (k 10)) | |
(let ((k (cc (lambda (bind) | |
(lambda (x) | |
(+ 1 (cc (lambda (k) | |
(bind k))))))))) | |
(k 10)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment