-
-
Save nkoguro/13ba5257847507e637416aa92a2e889c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
(use data.queue) | |
(use gauche.partcont) | |
(define queue (make-queue)) | |
(define (yield) | |
(shift cont | |
(enqueue! queue cont))) | |
(define (main args) | |
(enqueue! queue (lambda () | |
(guard (e (else (print "catch error!!"))) | |
(yield) | |
(error "err")))) | |
(while (dequeue! queue #f) | |
=> next | |
(print "==> call next") | |
(dynamic-wind | |
(lambda () | |
(print "start")) | |
(lambda () | |
(reset | |
(next))) | |
(lambda () | |
(print "end")))) | |
0) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment