added "autorequire"; preparing libraries for autorequire
[k8-xscheme:k8-xscheme.git] / lib / tests / coro_test0.scm
1 (define test-coroutine-1
2   (make-coroutine
3     (lambda (yield)
4       (display "HELLO!\n")
5       (yield 1)
6       (display "WORLD!\n")
7       (yield 2)
8       (display "SORRY, I'M OUT\n"))))
9
10 (test-coroutine-1 'status?)
11 ;suspended
12 (test-coroutine-1 'dead?)
13 ;#f
14 (test-coroutine-1 'alive?)
15 ;#t
16 (test-coroutine-1)
17 ;"HELLO!"
18 ;1
19 (test-coroutine-1)
20 ;"WORLD!"
21 ;2
22 (test-coroutine-1)
23 ;"SORRY, I'M OUT"
24 ;dead
25 (test-coroutine-1 'status?)
26 ;dead
27 (test-coroutine-1 'dead?)
28 ;#t
29 (test-coroutine-1)
30 ;error: dead-coroutine