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