Skip to content

Instantly share code, notes, and snippets.

@fogus
Forked from manuel/delimc.lisp
Created August 26, 2011 14:47
Show Gist options
  • Save fogus/1173565 to your computer and use it in GitHub Desktop.
Save fogus/1173565 to your computer and use it in GitHub Desktop.
Delimited control example
(run-cc
($lambda ()
($let ((p (make-prompt)))
(+ 2 ($push-prompt p
($if (with-sub-cont p
($lambda (k)
(+ ($push-sub-cont k #f)
($push-sub-cont k #t))))
3
4))))))
;; ==> 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment