https://github.com/akkartik/mu/blob/master/continuation1.mu
 1 # Example program showing that 'return-continuation-until-mark' can 'pause' a
 2 # function call, returning a continuation, and that calling the continuation
 3 # can 'resume' the paused function call.
 4 #
 5 # To run:
 6 #   $ git clone https://github.com/akkartik/mu
 7 #   $ cd mu
 8 #   $ ./mu continuation1.mu
 9 #
10 # Expected output:
11 #   1
12 
13 def main [
14   local-scope
15   k:continuation <- call-with-continuation-mark 100/mark, create-yielder
16   x:num <- call k  # should return 1
17   $print x 10/newline
18 ]
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight .c { color: #888888 } /* Comment */
.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */
.highlight .k { color: #008800; font-weight: bold } /* Keyword */
.highlight .ch { color: #88888