1 # Example program showing that a 'paused' continuation can be 'resumed'
2 # multiple times from the same point (but with changes to data).
5 # $ git clone https://github.com/akkartik/mu
7 # $ ./mu continuation2.mu
16 l:&:list:num <- copy null
20 k:continuation <- call-with-continuation-mark 100/mark, create-yielder, l
22 x:num, done?:bool <- call k
29 def create-yielder l:&:list:num -> n:num, done?:bool [
32 return-continuation-until-mark 100/mark
33 done? <- equal l, null
34 return-if done?, 0/dummy