1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 def main [
16 local-scope
17 l:&:list:num <- copy 0
18 l <- push 3, l
19 l <- push 2, l
20 l <- push 1, l
21 k:continuation <- call-with-continuation-mark create-yielder, l
22 {
23 ¦ x:num, done?:bool <- call k
24 ¦ break-if done?
25 ¦ $print x 10/newline
26 ¦ loop
27 }
28 ]
29
30 def create-yielder l:&:list:num -> n:num, done?:bool [
31 local-scope
32 load-inputs
33 return-continuation-until-mark
34 done? <- equal l, 0
35 return-if done?, 0
36 n <- first l
37 l <- rest l
38 ]