From 805d58c6aeeeba3e4989c0eed6781b3861e8fae0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 25 Jan 2018 22:39:31 -0800 Subject: 4199 --- html/continuation4.mu.html | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'html/continuation4.mu.html') diff --git a/html/continuation4.mu.html b/html/continuation4.mu.html index ecb81b8a..553d3d74 100644 --- a/html/continuation4.mu.html +++ b/html/continuation4.mu.html @@ -15,15 +15,14 @@ body { font-size: 12pt; font-family: monospace; color: #aaaaaa; background-color a { color:#eeeeee; text-decoration: none; } a:hover { text-decoration: underline; } * { font-size: 12pt; font-size: 1em; } -.Conceal { color: #4e4e4e; } +.muControl { color: #c0a020; } +.muRecipe { color: #ff8700; } .LineNr { color: #444444; } .Delimiter { color: #800080; } -.Comment { color: #9090ff; } -.Comment a { color:#0000ee; text-decoration:underline; } .Constant { color: #00a0a0; } .Special { color: #c00000; } -.muControl { color: #c0a020; } -.muRecipe { color: #ff8700; } +.Comment { color: #9090ff; } +.Comment a { color:#0000ee; text-decoration:underline; } --> @@ -73,31 +72,31 @@ if ('onhashchange' in window) { 13 # 2 14 # 3 15 -16 def main [ +16 def main [ 17 local-scope -18 l:&:list:num <- copy 0 +18 l:&:list:num <- copy 0 19 l <- push 3, l 20 l <- push 2, l 21 l <- push 1, l -22 k:continuation, x:num, done?:bool <- call-with-continuation-mark 100/mark, create-yielder, l +22 k:continuation, x:num, done?:bool <- call-with-continuation-mark 100/mark, create-yielder, l 23 { -24 ¦ break-if done? -25 ¦ $print x 10/newline -26 ¦ k, x:num, done?:bool <- call k -27 ¦ loop +24 break-if done? +25 $print x 10/newline +26 k, x:num, done?:bool <- call k +27 loop 28 } 29 ] 30 -31 def create-yielder l:&:list:num -> n:num, done?:bool [ +31 def create-yielder l:&:list:num -> n:num, done?:bool [ 32 local-scope 33 load-inputs 34 { -35 ¦ done? <- equal l, 0 -36 ¦ break-if done? -37 ¦ n <- first l -38 ¦ l <- rest l -39 ¦ return-continuation-until-mark 100/mark, n, done? -40 ¦ loop +35 done? <- equal l, 0 +36 break-if done? +37 n <- first l +38 l <- rest l +39 return-continuation-until-mark 100/mark, n, done? +40 loop 41 } 42 # A function that returns continuations shouldn't get the opportunity to 43 # return. Calling functions should stop calling its continuation after this -- cgit 1.4.1-2-gfad0