1 # example program showing that a function call can be 'paused' multiple times, 2 # creating different continuation values 3 4 def main [ 5 local-scope 6 $print [caller 0] 10/newline 7 k:continuation <- call-with-continuation-mark f 8 $print [caller 1] 10/newline 9 k <- call k 10 $print [caller 2] 10/newline 11 call k 12 ] 13 14 def f [ 15 local-scope 16 $print [callee 0] 10/newline 17 return-continuation-until-mark 18 $print [callee 1] 10/newline 19 return-continuation-until-mark 20 $print [callee 2] 10/newline 21 ]