From 088b57753fe93415b13fe06b3b398033e4ab937d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sun, 17 May 2015 18:04:25 -0700 Subject: 1393 --- callcc.mu | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 callcc.mu diff --git a/callcc.mu b/callcc.mu new file mode 100644 index 00000000..c9edfa47 --- /dev/null +++ b/callcc.mu @@ -0,0 +1,18 @@ +# example program: saving and reusing call-stacks or continuations + +recipe main [ +#? $start-tracing #? 1 + c:continuation <- f + continue-from c:continuation # <-- ..when you hit this +] + +recipe f [ + c:continuation <- g + reply c:continuation +] + +recipe g [ + c:continuation <- current-continuation # <-- loop back to here + $print 1:literal + reply c:continuation +] -- cgit 1.4.1-2-gfad0