From e82dc626685875d56738e733f7e18203f2ac7f9d Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Wed, 27 Dec 2017 20:19:46 -0800 Subject: 4164 --- html/075channel.mu.html | 2 +- html/088file.mu.html | 8 ++++---- html/092socket.mu.html | 6 +++--- html/channel.mu.html | 4 ++-- html/chessboard.mu.html | 14 +++++++------- html/continuation1.mu.html | 4 ++-- html/continuation2.mu.html | 4 ++-- html/continuation3.mu.html | 7 ++++--- html/continuation4.mu.html | 6 +++--- html/continuation5.mu.html | 6 +++--- html/fork.mu.html | 2 +- html/http-server.mu.html | 2 +- html/same-fringe.mu.html | 10 +++++----- 13 files changed, 38 insertions(+), 37 deletions(-) (limited to 'html') diff --git a/html/075channel.mu.html b/html/075channel.mu.html index d294b7cb..6aa979d9 100644 --- a/html/075channel.mu.html +++ b/html/075channel.mu.html @@ -534,7 +534,7 @@ if ('onhashchange' in window) { 470 ¦ assert empty?, [ 471 F buffer-lines-blocks-until-newline: channel should be empty after init] 472 ¦ # buffer stdin into buffered-stdin, try to read from buffered-stdin -473 ¦ buffer-routine:num <- start-running buffer-lines, source, buffered-stdin +473 ¦ buffer-routine:num <- start-running buffer-lines, source, buffered-stdin 474 ¦ wait-for-routine-to-block buffer-routine 475 ¦ empty? <- channel-empty? buffered-chan 476 ¦ assert empty?:bool, [ diff --git a/html/088file.mu.html b/html/088file.mu.html index 33d5c04d..686127dc 100644 --- a/html/088file.mu.html +++ b/html/088file.mu.html @@ -93,7 +93,7 @@ if ('onhashchange' in window) { 32 file:num <- $open-file-for-reading filename 33 return-unless file, 0/contents, 1/error? 34 contents:&:source:char, sink:&:sink:char <- new-channel 30 - 35 start-running receive-from-file file, sink + 35 start-running receive-from-file file, sink 36 ] 37 38 def slurp resources:&:resources, filename:text -> contents:text, error?:bool [ @@ -128,7 +128,7 @@ if ('onhashchange' in window) { 67 ¦ loop-unless found? 68 ¦ contents:&:source:char, sink:&:sink:char <- new-channel 30 69 ¦ curr-contents:text <- get tmp, contents:offset - 70 ¦ start-running receive-from-text curr-contents, sink + 70 ¦ start-running receive-from-text curr-contents, sink 71 ¦ return 72 } 73 return 0/not-found, 1/error @@ -171,7 +171,7 @@ if ('onhashchange' in window) { 110 { 111 ¦ break-unless resources 112 ¦ # fake file system -113 ¦ routine-id <- start-running transmit-to-fake-resource resources, filename, source +113 ¦ routine-id <- start-running transmit-to-fake-resource resources, filename, source 114 ¦ return 115 } 116 # real file system @@ -182,7 +182,7 @@ if ('onhashchange' in window) { 121 ¦ msg:text <- append [no such file: ] filename 122 ¦ assert file, msg 123 } -124 routine-id <- start-running transmit-to-file file, source +124 routine-id <- start-running transmit-to-file file, source 125 ] 126 127 def dump resources:&:resources, filename:text, contents:text -> resources:&:resources, error?:bool [ diff --git a/html/092socket.mu.html b/html/092socket.mu.html index 3f847cf9..b26e42b7 100644 --- a/html/092socket.mu.html +++ b/html/092socket.mu.html @@ -74,7 +74,7 @@ if ('onhashchange' in window) { 12 ¦ socket:num <- $open-server-socket port 13 ¦ assert socket, [ 14 F - example-server-test: $open-server-socket failed] - 15 ¦ handler-routine:number <- start-running serve-one-request socket, example-handler + 15 ¦ handler-routine:number <- start-running serve-one-request socket, example-handler 16 ] 17 source:&:source:char <- start-reading-from-network 0/real-resources, [localhost/], port 18 response:text <- drain source @@ -121,7 +121,7 @@ if ('onhashchange' in window) { 59 assert session, [ 60 F - example-server-test: $accept failed] 61 contents:&:source:char, sink:&:sink:char <- new-channel 30 - 62 start-running receive-from-socket session, sink + 62 start-running receive-from-socket session, sink 63 query:text <- drain contents 64 response:text <- call request-handler, query 65 write-to-socket session, response @@ -149,7 +149,7 @@ if ('onhashchange' in window) { 87 req:text <- interpolate [GET _ HTTP/1.1], path 88 request-socket socket, req 89 contents:&:source:char, sink:&:sink:char <- new-channel 10000 - 90 start-running receive-from-client-socket-and-close socket, sink + 90 start-running receive-from-client-socket-and-close socket, sink 91 ] 92 93 def request-socket socket:num, s:text -> socket:num [ diff --git a/html/channel.mu.html b/html/channel.mu.html index 42f5a909..d3ce4953 100644 --- a/html/channel.mu.html +++ b/html/channel.mu.html @@ -98,8 +98,8 @@ if ('onhashchange' in window) { 38 local-scope 39 source:&:source:char, sink:&:sink:char <- new-channel 3/capacity 40 # create two background 'routines' that communicate by a channel -41 routine1:num <- start-running producer, sink -42 routine2:num <- start-running consumer, source +41 routine1:num <- start-running producer, sink +42 routine2:num <- start-running consumer, source 43 wait-for-routine routine1 44 wait-for-routine routine2 45 ] diff --git a/html/chessboard.mu.html b/html/chessboard.mu.html index 4f99bb58..3ad48a2d 100644 --- a/html/chessboard.mu.html +++ b/html/chessboard.mu.html @@ -136,10 +136,10 @@ if ('onhashchange' in window) { 72 board:board <- initial-position 73 # hook up stdin 74 stdin-in:&:source:char, stdin-out:&:sink:char <- new-channel 10/capacity - 75 start-running send-keys-to-channel, console, stdin-out, screen + 75 start-running send-keys-to-channel, console, stdin-out, screen 76 # buffer lines in stdin 77 buffered-stdin-in:&:source:char, buffered-stdin-out:&:sink:char <- new-channel 10/capacity - 78 start-running buffer-lines, stdin-in, buffered-stdin-out + 78 start-running buffer-lines, stdin-in, buffered-stdin-out 79 { 80 ¦ print screen, [Stupid text-mode chessboard. White pieces in uppercase; black pieces in lowercase. No checking for legal moves. 81 ] @@ -420,7 +420,7 @@ if ('onhashchange' in window) { 356 local-scope 357 assume-screen 20/width, 2/height 358 source:&:source:char, sink:&:sink:char <- new-channel 2/capacity -359 read-move-routine:num/routine <- start-running read-move, source, screen:&:screen +359 read-move-routine:num/routine <- start-running read-move, source, screen:&:screen 360 run [ 361 ¦ # 'read-move' is waiting for keypress 362 ¦ wait-for-routine-to-block read-move-routine @@ -493,7 +493,7 @@ if ('onhashchange' in window) { 429 local-scope 430 assume-screen 20/width, 2/height 431 source:&:source:char, sink:&:sink:char <- new-channel 2/capacity -432 read-move-routine:num <- start-running read-move, source, screen:&:screen +432 read-move-routine:num <- start-running read-move, source, screen:&:screen 433 run [ 434 ¦ # 'read-move' is waiting for keypress 435 ¦ wait-for-routine-to-block read-move-routine @@ -521,7 +521,7 @@ if ('onhashchange' in window) { 457 local-scope 458 assume-screen 20/width, 2/height 459 source:&:source:char, sink:&:sink:char <- new-channel 2/capacity -460 read-move-routine:num <- start-running read-move, source, screen:&:screen +460 read-move-routine:num <- start-running read-move, source, screen:&:screen 461 run [ 462 ¦ # 'read-move' is waiting for keypress 463 ¦ wait-for-routine-to-block read-move-routine @@ -543,7 +543,7 @@ if ('onhashchange' in window) { 479 local-scope 480 assume-screen 20/width, 2/height 481 source:&:source:char, sink:&:sink:char <- new-channel 2/capacity -482 read-move-routine:num <- start-running read-move, source, screen:&:screen +482 read-move-routine:num <- start-running read-move, source, screen:&:screen 483 run [ 484 ¦ # 'read-move' is waiting for keypress 485 ¦ wait-for-routine-to-block read-move-routine @@ -566,7 +566,7 @@ if ('onhashchange' in window) { 502 local-scope 503 assume-screen 20/width, 2/height 504 source:&:source:char, sink:&:sink:char <- new-channel 2/capacity -505 read-move-routine:num <- start-running read-move, source, screen:&:screen +505 read-move-routine:num <- start-running read-move, source, screen:&:screen 506 run [ 507 ¦ # 'read-move' is waiting for keypress 508 ¦ wait-for-routine-to-block read-move-routine diff --git a/html/continuation1.mu.html b/html/continuation1.mu.html index aa2ab50a..0d652ffd 100644 --- a/html/continuation1.mu.html +++ b/html/continuation1.mu.html @@ -70,7 +70,7 @@ if ('onhashchange' in window) { 12 13 def main [ 14 local-scope -15 k:continuation <- call-with-continuation-mark 100/mark, create-yielder +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 ] @@ -78,7 +78,7 @@ if ('onhashchange' in window) { 20 def create-yielder -> n:num [ 21 local-scope 22 load-inputs -23 return-continuation-until-mark 100/mark +23 return-continuation-until-mark 100/mark 24 return 1 25 ] diff --git a/html/continuation2.mu.html b/html/continuation2.mu.html index f30381ff..7746bca0 100644 --- a/html/continuation2.mu.html +++ b/html/continuation2.mu.html @@ -77,7 +77,7 @@ if ('onhashchange' in window) { 17 l <- push 3, l 18 l <- push 2, l 19 l <- push 1, l -20 k:continuation <- call-with-continuation-mark 100/mark, create-yielder, l +20 k:continuation <- call-with-continuation-mark 100/mark, create-yielder, l 21 { 22 ¦ x:num, done?:bool <- call k 23 ¦ break-if done? @@ -89,7 +89,7 @@ if ('onhashchange' in window) { 29 def create-yielder l:&:list:num -> n:num, done?:bool [ 30 local-scope 31 load-inputs -32 return-continuation-until-mark 100/mark +32 return-continuation-until-mark 100/mark 33 done? <- equal l, 0/nil 34 return-if done?, 0/false 35 n <- first l diff --git a/html/continuation3.mu.html b/html/continuation3.mu.html index 928e3ec6..86ff18d6 100644 --- a/html/continuation3.mu.html +++ b/html/continuation3.mu.html @@ -20,6 +20,7 @@ a:hover { text-decoration: underline; } .Comment a { color:#0000ee; text-decoration:underline; } .Constant { color: #00a0a0; } .Special { color: #c00000; } +.muControl { color: #c0a020; } .muRecipe { color: #ff8700; } --> @@ -74,7 +75,7 @@ if ('onhashchange' in window) { 17 def main [ 18 local-scope 19 $print [caller 0] 10/newline -20 k:continuation <- call-with-continuation-mark 100/mark, f +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 @@ -84,9 +85,9 @@ if ('onhashchange' in window) { 27 def f [ 28 local-scope 29 $print [callee 0] 10/newline -30 return-continuation-until-mark 100/mark +30 return-continuation-until-mark 100/mark 31 $print [callee 1] 10/newline -32 return-continuation-until-mark 100/mark +32 return-continuation-until-mark 100/mark 33 $print [callee 2] 10/newline 34 ] diff --git a/html/continuation4.mu.html b/html/continuation4.mu.html index c0be8dc7..7e62e661 100644 --- a/html/continuation4.mu.html +++ b/html/continuation4.mu.html @@ -79,7 +79,7 @@ if ('onhashchange' in window) { 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 @@ -96,13 +96,13 @@ if ('onhashchange' in window) { 36 ¦ break-if done? 37 ¦ n <- first l 38 ¦ l <- rest l -39 ¦ return-continuation-until-mark 100/mark, n, done? +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 44 # point. -45 return-continuation-until-mark 100/mark, -1, done? +45 return-continuation-until-mark 100/mark, -1, done? 46 assert 0/false, [called too many times, ran out of continuations to return] 47 ] diff --git a/html/continuation5.mu.html b/html/continuation5.mu.html index 65a30cf1..b0b45a3b 100644 --- a/html/continuation5.mu.html +++ b/html/continuation5.mu.html @@ -80,7 +80,7 @@ if ('onhashchange' in window) { 20 l <- push 3, l 21 l <- push 2, l 22 l <- push 1, l -23 k:continuation, x:num, done?:bool <- call-with-continuation-mark 100/mark, create-yielder, l +23 k:continuation, x:num, done?:bool <- call-with-continuation-mark 100/mark, create-yielder, l 24 a:num <- copy 1 25 { 26 ¦ break-if done? @@ -101,10 +101,10 @@ if ('onhashchange' in window) { 41 ¦ n <- first l 42 ¦ l <- rest l 43 ¦ n <- add n, a -44 ¦ a <- return-continuation-until-mark 100/mark, n, done? # pause/resume +44 ¦ a <- return-continuation-until-mark 100/mark, n, done? # pause/resume 45 ¦ loop 46 } -47 return-continuation-until-mark 100/mark, -1, done? +47 return-continuation-until-mark 100/mark, -1, done? 48 assert 0/false, [called too many times, ran out of continuations to return] 49 ] diff --git a/html/fork.mu.html b/html/fork.mu.html index 7eeb180c..976c0db3 100644 --- a/html/fork.mu.html +++ b/html/fork.mu.html @@ -60,7 +60,7 @@ if ('onhashchange' in window) { 1 # example program: running multiple routines 2 3 def main [ - 4 start-running thread2 + 4 start-running thread2 5 { 6 ¦ $print 34 7 ¦ loop diff --git a/html/http-server.mu.html b/html/http-server.mu.html index 50e1d022..a6ebcea3 100644 --- a/html/http-server.mu.html +++ b/html/http-server.mu.html @@ -72,7 +72,7 @@ if ('onhashchange' in window) { 14 return-unless socket 15 session:num <- $accept socket 16 contents:&:source:char, sink:&:sink:char <- new-channel 30 -17 sink <- start-running receive-from-socket session, sink +17 sink <- start-running receive-from-socket session, sink 18 query:text <- drain contents 19 $print [Done reading from socket.], 10/newline 20 write-to-socket session, [HTTP/1.0 200 OK diff --git a/html/same-fringe.mu.html b/html/same-fringe.mu.html index 433af545..6c4a09ce 100644 --- a/html/same-fringe.mu.html +++ b/html/same-fringe.mu.html @@ -91,8 +91,8 @@ if ('onhashchange' in window) { 30 def same-fringe a:&:tree:_elem, b:&:tree:_elem -> result:bool [ 31 local-scope 32 load-inputs -33 k1:continuation <- call-with-continuation-mark 100/mark, process, a -34 k2:continuation <- call-with-continuation-mark 100/mark, process, b +33 k1:continuation <- call-with-continuation-mark 100/mark, process, a +34 k2:continuation <- call-with-continuation-mark 100/mark, process, b 35 { 36 ¦ k1, x:_elem, a-done?:bool <- call k1 37 ¦ k2, y:_elem, b-done?:bool <- call k2 @@ -109,10 +109,10 @@ if ('onhashchange' in window) { 48 def process t:&:tree:_elem [ 49 local-scope 50 load-inputs -51 return-continuation-until-mark 100/mark # initial +51 return-continuation-until-mark 100/mark # initial 52 traverse t 53 zero-val:&:_elem <- new _elem:type -54 return-continuation-until-mark 100/mark, *zero-val, 1/done # final +54 return-continuation-until-mark 100/mark, *zero-val, 1/done # final 55 assert 0/false, [continuation called past done] 56 ] 57 @@ -129,7 +129,7 @@ if ('onhashchange' in window) { 68 return-if r 69 # leaf 70 v:_elem <- get *t, val:offset -71 return-continuation-until-mark 100/mark, v, 0/not-done +71 return-continuation-until-mark 100/mark, v, 0/not-done 72 ] 73 74 # details -- cgit 1.4.1-2-gfad0