Skip to content

Instantly share code, notes, and snippets.

@takikawa
Created June 19, 2012 19:04
Show Gist options
  • Save takikawa/2955928 to your computer and use it in GitHub Desktop.
Save takikawa/2955928 to your computer and use it in GitHub Desktop.
expansion of reset0/shift0
#lang racket
(define pt (make-continuation-prompt-tag))
(call-with-continuation-prompt
(lambda ()
(+ 1
(call-with-composable-continuation
(lambda (k)
(abort-current-continuation
pt
(lambda ()
((lambda (k) k)
(lambda vals
(call-with-continuation-prompt
(lambda ()
(apply k vals))
pt
(lambda (thunk) (thunk)))))))))))
pt
(lambda (thunk) (thunk)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment