https://github.com/akkartik/mu/blob/master/continuation3.mu
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 def main [
18 local-scope
19 $print [caller 0] 10/newline
20 k:continuation <- call-with-continuation-mark 100/mark, f
21 $print [caller 1] 10/newline
22 k <- call k
23 $print [caller 2] 10/newline
24 call k
25 ]
26
27 def f [
28 local-scope
29 $print [callee 0] 10/newline
30 return-continuation-until-mark 100/mark
31 $print [callee 1] 10/newline
32 return-continuation-until-mark 100/mark
33 $print [callee 2] 10/newline
34 ]