Code from Marc Feeley's Scheme 2001 paper.

This commit is contained in:
Martin Gasbichler 2003-02-13 12:05:57 +00:00
parent 8dc4af1e38
commit 60069b30d4
3 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,18 @@
;; Taken from Marc Feeley's paper "A Better API for First-Class Continunations"
;; The version from the workshop proceedings contains a bug in continuation-capture.
;; This is the corrected version.
(define (continuation-capture receiver)
((call-with-current-continuation
(lambda (cont)
(lambda () (receiver cont))))))
(define (continuation-graft cont thunk)
(cont thunk))
(define (continuation-return cont . returned-values)
(continuation-graft
cont
(lambda () (apply values returned-values))))

View File

@ -0,0 +1,4 @@
(define-interface continuation-data-type-interface
(export continuation-capture
continuation-graft
continuation-return))

View File

@ -0,0 +1,3 @@
(define-structure continuation-data-type continuation-data-type-interface
(open scheme)
(files continuation-data-type))