diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-12-27 20:19:46 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-12-27 20:19:46 -0800 |
commit | e82dc626685875d56738e733f7e18203f2ac7f9d (patch) | |
tree | e24c3912c85409f44980f278854f522f4c9dccf9 /html | |
parent | c81fde0c44407b76d90601b992bb3cb74b6568fd (diff) | |
download | mu-e82dc626685875d56738e733f7e18203f2ac7f9d.tar.gz |
4164
Diffstat (limited to 'html')
-rw-r--r-- | html/075channel.mu.html | 2 | ||||
-rw-r--r-- | html/088file.mu.html | 8 | ||||
-rw-r--r-- | html/092socket.mu.html | 6 | ||||
-rw-r--r-- | html/channel.mu.html | 4 | ||||
-rw-r--r-- | html/chessboard.mu.html | 14 | ||||
-rw-r--r-- | html/continuation1.mu.html | 4 | ||||
-rw-r--r-- | html/continuation2.mu.html | 4 | ||||
-rw-r--r-- | html/continuation3.mu.html | 7 | ||||
-rw-r--r-- | html/continuation4.mu.html | 6 | ||||
-rw-r--r-- | html/continuation5.mu.html | 6 | ||||
-rw-r--r-- | html/fork.mu.html | 2 | ||||
-rw-r--r-- | html/http-server.mu.html | 2 | ||||
-rw-r--r-- | html/same-fringe.mu.html | 10 |
13 files changed, 38 insertions, 37 deletions
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) { <span id="L470" class="LineNr">470 </span> <span class="Conceal">¦</span> assert empty?, <span class="Constant">[ </span> <span id="L471" class="LineNr">471 </span><span class="Constant">F buffer-lines-blocks-until-newline: channel should be empty after init]</span> <span id="L472" class="LineNr">472 </span> <span class="Conceal">¦</span> <span class="Comment"># buffer stdin into buffered-stdin, try to read from buffered-stdin</span> -<span id="L473" class="LineNr">473 </span> <span class="Conceal">¦</span> buffer-routine:num <span class="Special"><-</span> start-running <a href='075channel.mu.html#L408'>buffer-lines</a>, <a href='075channel.mu.html#L43'>source</a>, buffered-stdin +<span id="L473" class="LineNr">473 </span> <span class="Conceal">¦</span> buffer-routine:num <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='075channel.mu.html#L408'>buffer-lines</a>, <a href='075channel.mu.html#L43'>source</a>, buffered-stdin <span id="L474" class="LineNr">474 </span> <span class="Conceal">¦</span> wait-for-routine-to-block buffer-routine <span id="L475" class="LineNr">475 </span> <span class="Conceal">¦</span> empty? <span class="Special"><-</span> <a href='075channel.mu.html#L370'>channel-empty?</a> buffered-chan <span id="L476" class="LineNr">476 </span> <span class="Conceal">¦</span> assert empty?:bool, <span class="Constant">[ </span> 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) { <span id="L32" class="LineNr"> 32 </span> file:num <span class="Special"><-</span> $open-file-for-reading filename <span id="L33" class="LineNr"> 33 </span> <span class="muControl">return-unless</span> file, <span class="Constant">0/contents</span>, <span class="Constant">1/error?</span> <span id="L34" class="LineNr"> 34 </span> contents:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a><span class="Constant"> 30</span> -<span id="L35" class="LineNr"> 35 </span> start-running <a href='088file.mu.html#L76'>receive-from-file</a> file, <a href='075channel.mu.html#L47'>sink</a> +<span id="L35" class="LineNr"> 35 </span> <span class="muControl">start-running</span> <a href='088file.mu.html#L76'>receive-from-file</a> file, <a href='075channel.mu.html#L47'>sink</a> <span id="L36" class="LineNr"> 36 </span>] <span id="L37" class="LineNr"> 37 </span> <span id="L38" class="LineNr"> 38 </span><span class="muRecipe">def</span> <a href='088file.mu.html#L38'>slurp</a> <a href='088file.mu.html#L11'>resources</a>:&:<a href='088file.mu.html#L11'>resources</a>, filename:text<span class="muRecipe"> -> </span>contents:text, error?:bool [ @@ -128,7 +128,7 @@ if ('onhashchange' in window) { <span id="L67" class="LineNr"> 67 </span> <span class="Conceal">¦</span> <span class="muControl">loop-unless</span> found? <span id="L68" class="LineNr"> 68 </span> <span class="Conceal">¦</span> contents:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a><span class="Constant"> 30</span> <span id="L69" class="LineNr"> 69 </span> <span class="Conceal">¦</span> curr-contents:text <span class="Special"><-</span> get tmp, <span class="Constant">contents:offset</span> -<span id="L70" class="LineNr"> 70 </span> <span class="Conceal">¦</span> start-running <a href='088file.mu.html#L89'>receive-from-text</a> curr-contents, <a href='075channel.mu.html#L47'>sink</a> +<span id="L70" class="LineNr"> 70 </span> <span class="Conceal">¦</span> <span class="muControl">start-running</span> <a href='088file.mu.html#L89'>receive-from-text</a> curr-contents, <a href='075channel.mu.html#L47'>sink</a> <span id="L71" class="LineNr"> 71 </span> <span class="Conceal">¦</span> <span class="muControl">return</span> <span id="L72" class="LineNr"> 72 </span> <span class="Delimiter">}</span> <span id="L73" class="LineNr"> 73 </span> <span class="muControl">return</span> <span class="Constant">0/not-found</span>, <span class="Constant">1/error</span> @@ -171,7 +171,7 @@ if ('onhashchange' in window) { <span id="L110" class="LineNr">110 </span> <span class="Delimiter">{</span> <span id="L111" class="LineNr">111 </span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> <a href='088file.mu.html#L11'>resources</a> <span id="L112" class="LineNr">112 </span> <span class="Conceal">¦</span> <span class="Comment"># fake file system</span> -<span id="L113" class="LineNr">113 </span> <span class="Conceal">¦</span> routine-id <span class="Special"><-</span> start-running <a href='088file.mu.html#L162'>transmit-to-fake-resource</a> <a href='088file.mu.html#L11'>resources</a>, filename, <a href='075channel.mu.html#L43'>source</a> +<span id="L113" class="LineNr">113 </span> <span class="Conceal">¦</span> routine-id <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='088file.mu.html#L162'>transmit-to-fake-resource</a> <a href='088file.mu.html#L11'>resources</a>, filename, <a href='075channel.mu.html#L43'>source</a> <span id="L114" class="LineNr">114 </span> <span class="Conceal">¦</span> <span class="muControl">return</span> <span id="L115" class="LineNr">115 </span> <span class="Delimiter">}</span> <span id="L116" class="LineNr">116 </span> <span class="Comment"># real file system</span> @@ -182,7 +182,7 @@ if ('onhashchange' in window) { <span id="L121" class="LineNr">121 </span> <span class="Conceal">¦</span> msg:text <span class="Special"><-</span> append <span class="Constant">[no such file: ]</span> filename <span id="L122" class="LineNr">122 </span> <span class="Conceal">¦</span> assert file, msg <span id="L123" class="LineNr">123 </span> <span class="Delimiter">}</span> -<span id="L124" class="LineNr">124 </span> routine-id <span class="Special"><-</span> start-running <a href='088file.mu.html#L150'>transmit-to-file</a> file, <a href='075channel.mu.html#L43'>source</a> +<span id="L124" class="LineNr">124 </span> routine-id <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='088file.mu.html#L150'>transmit-to-file</a> file, <a href='075channel.mu.html#L43'>source</a> <span id="L125" class="LineNr">125 </span>] <span id="L126" class="LineNr">126 </span> <span id="L127" class="LineNr">127 </span><span class="muRecipe">def</span> <a href='088file.mu.html#L127'>dump</a> <a href='088file.mu.html#L11'>resources</a>:&:<a href='088file.mu.html#L11'>resources</a>, filename:text, contents:text<span class="muRecipe"> -> </span><a href='088file.mu.html#L11'>resources</a>:&:<a href='088file.mu.html#L11'>resources</a>, 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) { <span id="L12" class="LineNr"> 12 </span> <span class="Conceal">¦</span> socket:num <span class="Special"><-</span> $open-server-socket port <span id="L13" class="LineNr"> 13 </span> <span class="Conceal">¦</span> assert socket, <span class="Constant">[ </span> <span id="L14" class="LineNr"> 14 </span><span class="Constant">F - example-server-test: $open-server-socket failed]</span> -<span id="L15" class="LineNr"> 15 </span> <span class="Conceal">¦</span> handler-routine:number <span class="Special"><-</span> start-running <a href='092socket.mu.html#L55'>serve-one-request</a> socket, <a href='092socket.mu.html#L26'>example-handler</a> +<span id="L15" class="LineNr"> 15 </span> <span class="Conceal">¦</span> handler-routine:number <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='092socket.mu.html#L55'>serve-one-request</a> socket, <a href='092socket.mu.html#L26'>example-handler</a> <span id="L16" class="LineNr"> 16 </span> ] <span id="L17" class="LineNr"> 17 </span> <a href='075channel.mu.html#L43'>source</a>:&:<a href='075channel.mu.html#L43'>source</a>:char <span class="Special"><-</span> <a href='092socket.mu.html#L69'>start-reading-from-network</a> <span class="Constant">0/real-resources</span>, <span class="Constant">[localhost/]</span>, port <span id="L18" class="LineNr"> 18 </span> response:text <span class="Special"><-</span> <a href='075channel.mu.html#L507'>drain</a> <a href='075channel.mu.html#L43'>source</a> @@ -121,7 +121,7 @@ if ('onhashchange' in window) { <span id="L59" class="LineNr"> 59 </span> assert session, <span class="Constant">[ </span> <span id="L60" class="LineNr"> 60 </span><span class="Constant">F - example-server-test: $accept failed]</span> <span id="L61" class="LineNr"> 61 </span> contents:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a><span class="Constant"> 30</span> -<span id="L62" class="LineNr"> 62 </span> start-running <a href='092socket.mu.html#L104'>receive-from-socket</a> session, <a href='075channel.mu.html#L47'>sink</a> +<span id="L62" class="LineNr"> 62 </span> <span class="muControl">start-running</span> <a href='092socket.mu.html#L104'>receive-from-socket</a> session, <a href='075channel.mu.html#L47'>sink</a> <span id="L63" class="LineNr"> 63 </span> query:text <span class="Special"><-</span> <a href='075channel.mu.html#L507'>drain</a> contents <span id="L64" class="LineNr"> 64 </span> response:text <span class="Special"><-</span> call <a href='092socket.mu.html#L53'>request-handler</a>, query <span id="L65" class="LineNr"> 65 </span> <a href='092socket.mu.html#L132'>write-to-socket</a> session, response @@ -149,7 +149,7 @@ if ('onhashchange' in window) { <span id="L87" class="LineNr"> 87 </span> req:text <span class="Special"><-</span> <a href='061text.mu.html#L520'>interpolate</a> <span class="Constant">[GET _ HTTP/1.1]</span>, path <span id="L88" class="LineNr"> 88 </span> <a href='092socket.mu.html#L93'>request-socket</a> socket, req <span id="L89" class="LineNr"> 89 </span> contents:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a><span class="Constant"> 10000</span> -<span id="L90" class="LineNr"> 90 </span> start-running <a href='092socket.mu.html#L125'>receive-from-client-socket-and-close</a> socket, <a href='075channel.mu.html#L47'>sink</a> +<span id="L90" class="LineNr"> 90 </span> <span class="muControl">start-running</span> <a href='092socket.mu.html#L125'>receive-from-client-socket-and-close</a> socket, <a href='075channel.mu.html#L47'>sink</a> <span id="L91" class="LineNr"> 91 </span>] <span id="L92" class="LineNr"> 92 </span> <span id="L93" class="LineNr"> 93 </span><span class="muRecipe">def</span> <a href='092socket.mu.html#L93'>request-socket</a> socket:num, s:text<span class="muRecipe"> -> </span>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) { <span id="L38" class="LineNr">38 </span> <span class="Constant">local-scope</span> <span id="L39" class="LineNr">39 </span> <a href='075channel.mu.html#L43'>source</a>:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">3/capacity</span> <span id="L40" class="LineNr">40 </span> <span class="Comment"># create two background 'routines' that communicate by a channel</span> -<span id="L41" class="LineNr">41 </span> routine1:num <span class="Special"><-</span> start-running <a href='channel.mu.html#L3'>producer</a>, <a href='075channel.mu.html#L47'>sink</a> -<span id="L42" class="LineNr">42 </span> routine2:num <span class="Special"><-</span> start-running <a href='channel.mu.html#L22'>consumer</a>, <a href='075channel.mu.html#L43'>source</a> +<span id="L41" class="LineNr">41 </span> routine1:num <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='channel.mu.html#L3'>producer</a>, <a href='075channel.mu.html#L47'>sink</a> +<span id="L42" class="LineNr">42 </span> routine2:num <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='channel.mu.html#L22'>consumer</a>, <a href='075channel.mu.html#L43'>source</a> <span id="L43" class="LineNr">43 </span> wait-for-routine routine1 <span id="L44" class="LineNr">44 </span> wait-for-routine routine2 <span id="L45" class="LineNr">45 </span>] 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) { <span id="L72" class="LineNr"> 72 </span> <a href='chessboard.mu.html#L67'>board</a>:<a href='chessboard.mu.html#L67'>board</a> <span class="Special"><-</span> <a href='chessboard.mu.html#L180'>initial-position</a> <span id="L73" class="LineNr"> 73 </span> <span class="Comment"># hook up stdin</span> <span id="L74" class="LineNr"> 74 </span> stdin-in:&:<a href='075channel.mu.html#L43'>source</a>:char, stdin-out:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">10/capacity</span> -<span id="L75" class="LineNr"> 75 </span> start-running <a href='084console.mu.html#L73'>send-keys-to-channel</a>, <a href='084console.mu.html#L23'>console</a>, stdin-out, <a href='081print.mu.html#L16'>screen</a> +<span id="L75" class="LineNr"> 75 </span> <span class="muControl">start-running</span> <a href='084console.mu.html#L73'>send-keys-to-channel</a>, <a href='084console.mu.html#L23'>console</a>, stdin-out, <a href='081print.mu.html#L16'>screen</a> <span id="L76" class="LineNr"> 76 </span> <span class="Comment"># buffer lines in stdin</span> <span id="L77" class="LineNr"> 77 </span> buffered-stdin-in:&:<a href='075channel.mu.html#L43'>source</a>:char, buffered-stdin-out:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">10/capacity</span> -<span id="L78" class="LineNr"> 78 </span> start-running <a href='075channel.mu.html#L408'>buffer-lines</a>, stdin-in, buffered-stdin-out +<span id="L78" class="LineNr"> 78 </span> <span class="muControl">start-running</span> <a href='075channel.mu.html#L408'>buffer-lines</a>, stdin-in, buffered-stdin-out <span id="L79" class="LineNr"> 79 </span> <span class="Delimiter">{</span> <span id="L80" class="LineNr"> 80 </span> <span class="Conceal">¦</span> print <a href='081print.mu.html#L16'>screen</a>, <span class="Constant">[Stupid text-mode chessboard. White pieces in uppercase; black pieces in lowercase. No checking for legal moves.</span> <span id="L81" class="LineNr"> 81 </span><span class="Constant">]</span> @@ -420,7 +420,7 @@ if ('onhashchange' in window) { <span id="L356" class="LineNr">356 </span> <span class="Constant">local-scope</span> <span id="L357" class="LineNr">357 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> <span id="L358" class="LineNr">358 </span> <a href='075channel.mu.html#L43'>source</a>:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">2/capacity</span> -<span id="L359" class="LineNr">359 </span> read-move-routine:num/routine <span class="Special"><-</span> start-running <a href='chessboard.mu.html#L238'>read-move</a>, <a href='075channel.mu.html#L43'>source</a>, <a href='081print.mu.html#L16'>screen</a>:&:<a href='081print.mu.html#L16'>screen</a> +<span id="L359" class="LineNr">359 </span> read-move-routine:num/routine <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='chessboard.mu.html#L238'>read-move</a>, <a href='075channel.mu.html#L43'>source</a>, <a href='081print.mu.html#L16'>screen</a>:&:<a href='081print.mu.html#L16'>screen</a> <span id="L360" class="LineNr">360 </span> run [ <span id="L361" class="LineNr">361 </span> <span class="Conceal">¦</span> <span class="Comment"># 'read-move' is waiting for keypress</span> <span id="L362" class="LineNr">362 </span> <span class="Conceal">¦</span> wait-for-routine-to-block read-move-routine @@ -493,7 +493,7 @@ if ('onhashchange' in window) { <span id="L429" class="LineNr">429 </span> <span class="Constant">local-scope</span> <span id="L430" class="LineNr">430 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> <span id="L431" class="LineNr">431 </span> <a href='075channel.mu.html#L43'>source</a>:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">2/capacity</span> -<span id="L432" class="LineNr">432 </span> read-move-routine:num <span class="Special"><-</span> start-running <a href='chessboard.mu.html#L238'>read-move</a>, <a href='075channel.mu.html#L43'>source</a>, <a href='081print.mu.html#L16'>screen</a>:&:<a href='081print.mu.html#L16'>screen</a> +<span id="L432" class="LineNr">432 </span> read-move-routine:num <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='chessboard.mu.html#L238'>read-move</a>, <a href='075channel.mu.html#L43'>source</a>, <a href='081print.mu.html#L16'>screen</a>:&:<a href='081print.mu.html#L16'>screen</a> <span id="L433" class="LineNr">433 </span> run [ <span id="L434" class="LineNr">434 </span> <span class="Conceal">¦</span> <span class="Comment"># 'read-move' is waiting for keypress</span> <span id="L435" class="LineNr">435 </span> <span class="Conceal">¦</span> wait-for-routine-to-block read-move-routine @@ -521,7 +521,7 @@ if ('onhashchange' in window) { <span id="L457" class="LineNr">457 </span> <span class="Constant">local-scope</span> <span id="L458" class="LineNr">458 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> <span id="L459" class="LineNr">459 </span> <a href='075channel.mu.html#L43'>source</a>:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">2/capacity</span> -<span id="L460" class="LineNr">460 </span> read-move-routine:num <span class="Special"><-</span> start-running <a href='chessboard.mu.html#L238'>read-move</a>, <a href='075channel.mu.html#L43'>source</a>, <a href='081print.mu.html#L16'>screen</a>:&:<a href='081print.mu.html#L16'>screen</a> +<span id="L460" class="LineNr">460 </span> read-move-routine:num <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='chessboard.mu.html#L238'>read-move</a>, <a href='075channel.mu.html#L43'>source</a>, <a href='081print.mu.html#L16'>screen</a>:&:<a href='081print.mu.html#L16'>screen</a> <span id="L461" class="LineNr">461 </span> run [ <span id="L462" class="LineNr">462 </span> <span class="Conceal">¦</span> <span class="Comment"># 'read-move' is waiting for keypress</span> <span id="L463" class="LineNr">463 </span> <span class="Conceal">¦</span> wait-for-routine-to-block read-move-routine @@ -543,7 +543,7 @@ if ('onhashchange' in window) { <span id="L479" class="LineNr">479 </span> <span class="Constant">local-scope</span> <span id="L480" class="LineNr">480 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> <span id="L481" class="LineNr">481 </span> <a href='075channel.mu.html#L43'>source</a>:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">2/capacity</span> -<span id="L482" class="LineNr">482 </span> read-move-routine:num <span class="Special"><-</span> start-running <a href='chessboard.mu.html#L238'>read-move</a>, <a href='075channel.mu.html#L43'>source</a>, <a href='081print.mu.html#L16'>screen</a>:&:<a href='081print.mu.html#L16'>screen</a> +<span id="L482" class="LineNr">482 </span> read-move-routine:num <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='chessboard.mu.html#L238'>read-move</a>, <a href='075channel.mu.html#L43'>source</a>, <a href='081print.mu.html#L16'>screen</a>:&:<a href='081print.mu.html#L16'>screen</a> <span id="L483" class="LineNr">483 </span> run [ <span id="L484" class="LineNr">484 </span> <span class="Conceal">¦</span> <span class="Comment"># 'read-move' is waiting for keypress</span> <span id="L485" class="LineNr">485 </span> <span class="Conceal">¦</span> wait-for-routine-to-block read-move-routine @@ -566,7 +566,7 @@ if ('onhashchange' in window) { <span id="L502" class="LineNr">502 </span> <span class="Constant">local-scope</span> <span id="L503" class="LineNr">503 </span> assume-screen <span class="Constant">20/width</span>, <span class="Constant">2/height</span> <span id="L504" class="LineNr">504 </span> <a href='075channel.mu.html#L43'>source</a>:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a> <span class="Constant">2/capacity</span> -<span id="L505" class="LineNr">505 </span> read-move-routine:num <span class="Special"><-</span> start-running <a href='chessboard.mu.html#L238'>read-move</a>, <a href='075channel.mu.html#L43'>source</a>, <a href='081print.mu.html#L16'>screen</a>:&:<a href='081print.mu.html#L16'>screen</a> +<span id="L505" class="LineNr">505 </span> read-move-routine:num <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='chessboard.mu.html#L238'>read-move</a>, <a href='075channel.mu.html#L43'>source</a>, <a href='081print.mu.html#L16'>screen</a>:&:<a href='081print.mu.html#L16'>screen</a> <span id="L506" class="LineNr">506 </span> run [ <span id="L507" class="LineNr">507 </span> <span class="Conceal">¦</span> <span class="Comment"># 'read-move' is waiting for keypress</span> <span id="L508" class="LineNr">508 </span> <span class="Conceal">¦</span> 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) { <span id="L12" class="LineNr">12 </span> <span id="L13" class="LineNr">13 </span><span class="muRecipe">def</span> <a href='continuation1.mu.html#L13'>main</a> [ <span id="L14" class="LineNr">14 </span> <span class="Constant">local-scope</span> -<span id="L15" class="LineNr">15 </span> k:continuation <span class="Special"><-</span> call-with-continuation-mark <span class="Constant">100/mark</span>, <a href='continuation1.mu.html#L20'>create-yielder</a> +<span id="L15" class="LineNr">15 </span> k:continuation <span class="Special"><-</span> <span class="muControl">call-with-continuation-mark</span> <span class="Constant">100/mark</span>, <a href='continuation1.mu.html#L20'>create-yielder</a> <span id="L16" class="LineNr">16 </span> x:num <span class="Special"><-</span> call k <span class="Comment"># should return 1</span> <span id="L17" class="LineNr">17 </span> $print x <span class="Constant">10/newline</span> <span id="L18" class="LineNr">18 </span>] @@ -78,7 +78,7 @@ if ('onhashchange' in window) { <span id="L20" class="LineNr">20 </span><span class="muRecipe">def</span> <a href='continuation1.mu.html#L20'>create-yielder</a><span class="muRecipe"> -> </span>n:num [ <span id="L21" class="LineNr">21 </span> <span class="Constant">local-scope</span> <span id="L22" class="LineNr">22 </span> <span class="Constant">load-inputs</span> -<span id="L23" class="LineNr">23 </span> return-continuation-until-mark <span class="Constant">100/mark</span> +<span id="L23" class="LineNr">23 </span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span> <span id="L24" class="LineNr">24 </span> <span class="muControl">return</span><span class="Constant"> 1</span> <span id="L25" class="LineNr">25 </span>] </pre> 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) { <span id="L17" class="LineNr">17 </span> l <span class="Special"><-</span> push<span class="Constant"> 3</span>, l <span id="L18" class="LineNr">18 </span> l <span class="Special"><-</span> push<span class="Constant"> 2</span>, l <span id="L19" class="LineNr">19 </span> l <span class="Special"><-</span> push<span class="Constant"> 1</span>, l -<span id="L20" class="LineNr">20 </span> k:continuation <span class="Special"><-</span> call-with-continuation-mark <span class="Constant">100/mark</span>, <a href='continuation2.mu.html#L29'>create-yielder</a>, l +<span id="L20" class="LineNr">20 </span> k:continuation <span class="Special"><-</span> <span class="muControl">call-with-continuation-mark</span> <span class="Constant">100/mark</span>, <a href='continuation2.mu.html#L29'>create-yielder</a>, l <span id="L21" class="LineNr">21 </span> <span class="Delimiter">{</span> <span id="L22" class="LineNr">22 </span> <span class="Conceal">¦</span> x:num, done?:bool <span class="Special"><-</span> call k <span id="L23" class="LineNr">23 </span> <span class="Conceal">¦</span> <span class="muControl">break-if</span> done? @@ -89,7 +89,7 @@ if ('onhashchange' in window) { <span id="L29" class="LineNr">29 </span><span class="muRecipe">def</span> <a href='continuation2.mu.html#L29'>create-yielder</a> l:&:<a href='064list.mu.html#L6'>list</a>:num<span class="muRecipe"> -> </span>n:num, done?:bool [ <span id="L30" class="LineNr">30 </span> <span class="Constant">local-scope</span> <span id="L31" class="LineNr">31 </span> <span class="Constant">load-inputs</span> -<span id="L32" class="LineNr">32 </span> return-continuation-until-mark <span class="Constant">100/mark</span> +<span id="L32" class="LineNr">32 </span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span> <span id="L33" class="LineNr">33 </span> done? <span class="Special"><-</span> equal l, <span class="Constant">0/nil</span> <span id="L34" class="LineNr">34 </span> <span class="muControl">return-if</span> done?, <span class="Constant">0/false</span> <span id="L35" class="LineNr">35 </span> n <span class="Special"><-</span> 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; } --> </style> @@ -74,7 +75,7 @@ if ('onhashchange' in window) { <span id="L17" class="LineNr">17 </span><span class="muRecipe">def</span> <a href='continuation3.mu.html#L17'>main</a> [ <span id="L18" class="LineNr">18 </span> <span class="Constant">local-scope</span> <span id="L19" class="LineNr">19 </span> $print <span class="Constant">[caller 0]</span> <span class="Constant">10/newline</span> -<span id="L20" class="LineNr">20 </span> k:continuation <span class="Special"><-</span> call-with-continuation-mark <span class="Constant">100/mark</span>, <a href='continuation3.mu.html#L27'>f</a> +<span id="L20" class="LineNr">20 </span> k:continuation <span class="Special"><-</span> <span class="muControl">call-with-continuation-mark</span> <span class="Constant">100/mark</span>, <a href='continuation3.mu.html#L27'>f</a> <span id="L21" class="LineNr">21 </span> $print <span class="Constant">[caller 1]</span> <span class="Constant">10/newline</span> <span id="L22" class="LineNr">22 </span> k <span class="Special"><-</span> call k <span id="L23" class="LineNr">23 </span> $print <span class="Constant">[caller 2]</span> <span class="Constant">10/newline</span> @@ -84,9 +85,9 @@ if ('onhashchange' in window) { <span id="L27" class="LineNr">27 </span><span class="muRecipe">def</span> <a href='continuation3.mu.html#L27'>f</a> [ <span id="L28" class="LineNr">28 </span> <span class="Constant">local-scope</span> <span id="L29" class="LineNr">29 </span> $print <span class="Constant">[callee 0]</span> <span class="Constant">10/newline</span> -<span id="L30" class="LineNr">30 </span> return-continuation-until-mark <span class="Constant">100/mark</span> +<span id="L30" class="LineNr">30 </span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span> <span id="L31" class="LineNr">31 </span> $print <span class="Constant">[callee 1]</span> <span class="Constant">10/newline</span> -<span id="L32" class="LineNr">32 </span> return-continuation-until-mark <span class="Constant">100/mark</span> +<span id="L32" class="LineNr">32 </span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span> <span id="L33" class="LineNr">33 </span> $print <span class="Constant">[callee 2]</span> <span class="Constant">10/newline</span> <span id="L34" class="LineNr">34 </span>] </pre> 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) { <span id="L19" class="LineNr">19 </span> l <span class="Special"><-</span> push<span class="Constant"> 3</span>, l <span id="L20" class="LineNr">20 </span> l <span class="Special"><-</span> push<span class="Constant"> 2</span>, l <span id="L21" class="LineNr">21 </span> l <span class="Special"><-</span> push<span class="Constant"> 1</span>, l -<span id="L22" class="LineNr">22 </span> k:continuation, x:num, done?:bool <span class="Special"><-</span> call-with-continuation-mark <span class="Constant">100/mark</span>, <a href='continuation4.mu.html#L31'>create-yielder</a>, l +<span id="L22" class="LineNr">22 </span> k:continuation, x:num, done?:bool <span class="Special"><-</span> <span class="muControl">call-with-continuation-mark</span> <span class="Constant">100/mark</span>, <a href='continuation4.mu.html#L31'>create-yielder</a>, l <span id="L23" class="LineNr">23 </span> <span class="Delimiter">{</span> <span id="L24" class="LineNr">24 </span> <span class="Conceal">¦</span> <span class="muControl">break-if</span> done? <span id="L25" class="LineNr">25 </span> <span class="Conceal">¦</span> $print x <span class="Constant">10/newline</span> @@ -96,13 +96,13 @@ if ('onhashchange' in window) { <span id="L36" class="LineNr">36 </span> <span class="Conceal">¦</span> <span class="muControl">break-if</span> done? <span id="L37" class="LineNr">37 </span> <span class="Conceal">¦</span> n <span class="Special"><-</span> first l <span id="L38" class="LineNr">38 </span> <span class="Conceal">¦</span> l <span class="Special"><-</span> <a href='064list.mu.html#L24'>rest</a> l -<span id="L39" class="LineNr">39 </span> <span class="Conceal">¦</span> return-continuation-until-mark <span class="Constant">100/mark</span>, n, done? +<span id="L39" class="LineNr">39 </span> <span class="Conceal">¦</span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span>, n, done? <span id="L40" class="LineNr">40 </span> <span class="Conceal">¦</span> <span class="muControl">loop</span> <span id="L41" class="LineNr">41 </span> <span class="Delimiter">}</span> <span id="L42" class="LineNr">42 </span> <span class="Comment"># A function that returns continuations shouldn't get the opportunity to</span> <span id="L43" class="LineNr">43 </span> <span class="Comment"># return. Calling functions should stop calling its continuation after this</span> <span id="L44" class="LineNr">44 </span> <span class="Comment"># point.</span> -<span id="L45" class="LineNr">45 </span> return-continuation-until-mark <span class="Constant">100/mark</span>,<span class="Constant"> -1</span>, done? +<span id="L45" class="LineNr">45 </span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span>,<span class="Constant"> -1</span>, done? <span id="L46" class="LineNr">46 </span> assert <span class="Constant">0/false</span>, <span class="Constant">[called too many times, ran out of continuations to return]</span> <span id="L47" class="LineNr">47 </span>] </pre> 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) { <span id="L20" class="LineNr">20 </span> l <span class="Special"><-</span> push<span class="Constant"> 3</span>, l <span id="L21" class="LineNr">21 </span> l <span class="Special"><-</span> push<span class="Constant"> 2</span>, l <span id="L22" class="LineNr">22 </span> l <span class="Special"><-</span> push<span class="Constant"> 1</span>, l -<span id="L23" class="LineNr">23 </span> k:continuation, x:num, done?:bool <span class="Special"><-</span> call-with-continuation-mark <span class="Constant">100/mark</span>, <a href='continuation5.mu.html#L34'>create-yielder</a>, l +<span id="L23" class="LineNr">23 </span> k:continuation, x:num, done?:bool <span class="Special"><-</span> <span class="muControl">call-with-continuation-mark</span> <span class="Constant">100/mark</span>, <a href='continuation5.mu.html#L34'>create-yielder</a>, l <span id="L24" class="LineNr">24 </span> a:num <span class="Special"><-</span> copy<span class="Constant"> 1</span> <span id="L25" class="LineNr">25 </span> <span class="Delimiter">{</span> <span id="L26" class="LineNr">26 </span> <span class="Conceal">¦</span> <span class="muControl">break-if</span> done? @@ -101,10 +101,10 @@ if ('onhashchange' in window) { <span id="L41" class="LineNr">41 </span> <span class="Conceal">¦</span> n <span class="Special"><-</span> first l <span id="L42" class="LineNr">42 </span> <span class="Conceal">¦</span> l <span class="Special"><-</span> <a href='064list.mu.html#L24'>rest</a> l <span id="L43" class="LineNr">43 </span> <span class="Conceal">¦</span> n <span class="Special"><-</span> add n, a -<span id="L44" class="LineNr">44 </span> <span class="Conceal">¦</span> a <span class="Special"><-</span> return-continuation-until-mark <span class="Constant">100/mark</span>, n, done? <span class="Comment"># pause/resume</span> +<span id="L44" class="LineNr">44 </span> <span class="Conceal">¦</span> a <span class="Special"><-</span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span>, n, done? <span class="Comment"># pause/resume</span> <span id="L45" class="LineNr">45 </span> <span class="Conceal">¦</span> <span class="muControl">loop</span> <span id="L46" class="LineNr">46 </span> <span class="Delimiter">}</span> -<span id="L47" class="LineNr">47 </span> return-continuation-until-mark <span class="Constant">100/mark</span>,<span class="Constant"> -1</span>, done? +<span id="L47" class="LineNr">47 </span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span>,<span class="Constant"> -1</span>, done? <span id="L48" class="LineNr">48 </span> assert <span class="Constant">0/false</span>, <span class="Constant">[called too many times, ran out of continuations to return]</span> <span id="L49" class="LineNr">49 </span>] </pre> 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) { <span id="L1" class="LineNr"> 1 </span><span class="Comment"># example program: running multiple routines</span> <span id="L2" class="LineNr"> 2 </span> <span id="L3" class="LineNr"> 3 </span><span class="muRecipe">def</span> <a href='fork.mu.html#L3'>main</a> [ -<span id="L4" class="LineNr"> 4 </span> start-running <a href='fork.mu.html#L11'>thread2</a> +<span id="L4" class="LineNr"> 4 </span> <span class="muControl">start-running</span> <a href='fork.mu.html#L11'>thread2</a> <span id="L5" class="LineNr"> 5 </span> <span class="Delimiter">{</span> <span id="L6" class="LineNr"> 6 </span> <span class="Conceal">¦</span> $print<span class="Constant"> 34</span> <span id="L7" class="LineNr"> 7 </span> <span class="Conceal">¦</span> <span class="muControl">loop</span> 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) { <span id="L14" class="LineNr">14 </span> <span class="muControl">return-unless</span> socket <span id="L15" class="LineNr">15 </span> session:num <span class="Special"><-</span> $accept socket <span id="L16" class="LineNr">16 </span> contents:&:<a href='075channel.mu.html#L43'>source</a>:char, <a href='075channel.mu.html#L47'>sink</a>:&:<a href='075channel.mu.html#L47'>sink</a>:char <span class="Special"><-</span> <a href='075channel.mu.html#L51'>new-channel</a><span class="Constant"> 30</span> -<span id="L17" class="LineNr">17 </span> <a href='075channel.mu.html#L47'>sink</a> <span class="Special"><-</span> start-running <a href='092socket.mu.html#L104'>receive-from-socket</a> session, <a href='075channel.mu.html#L47'>sink</a> +<span id="L17" class="LineNr">17 </span> <a href='075channel.mu.html#L47'>sink</a> <span class="Special"><-</span> <span class="muControl">start-running</span> <a href='092socket.mu.html#L104'>receive-from-socket</a> session, <a href='075channel.mu.html#L47'>sink</a> <span id="L18" class="LineNr">18 </span> query:text <span class="Special"><-</span> <a href='075channel.mu.html#L507'>drain</a> contents <span id="L19" class="LineNr">19 </span> $print <span class="Constant">[Done reading from socket.]</span>, <span class="Constant">10/newline</span> <span id="L20" class="LineNr">20 </span> <a href='092socket.mu.html#L132'>write-to-socket</a> session, <span class="Constant">[HTTP/1.0 200 OK</span> 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) { <span id="L30" class="LineNr">30 </span><span class="muRecipe">def</span> <a href='same-fringe.mu.html#L30'>same-fringe</a> a:&:<a href='same-fringe.mu.html#L9'>tree</a>:_elem, b:&:<a href='same-fringe.mu.html#L9'>tree</a>:_elem<span class="muRecipe"> -> </span>result:bool [ <span id="L31" class="LineNr">31 </span> <span class="Constant">local-scope</span> <span id="L32" class="LineNr">32 </span> <span class="Constant">load-inputs</span> -<span id="L33" class="LineNr">33 </span> k1:continuation <span class="Special"><-</span> call-with-continuation-mark <span class="Constant">100/mark</span>, <a href='same-fringe.mu.html#L48'>process</a>, a -<span id="L34" class="LineNr">34 </span> k2:continuation <span class="Special"><-</span> call-with-continuation-mark <span class="Constant">100/mark</span>, <a href='same-fringe.mu.html#L48'>process</a>, b +<span id="L33" class="LineNr">33 </span> k1:continuation <span class="Special"><-</span> <span class="muControl">call-with-continuation-mark</span> <span class="Constant">100/mark</span>, <a href='same-fringe.mu.html#L48'>process</a>, a +<span id="L34" class="LineNr">34 </span> k2:continuation <span class="Special"><-</span> <span class="muControl">call-with-continuation-mark</span> <span class="Constant">100/mark</span>, <a href='same-fringe.mu.html#L48'>process</a>, b <span id="L35" class="LineNr">35 </span> <span class="Delimiter">{</span> <span id="L36" class="LineNr">36 </span> <span class="Conceal">¦</span> k1, x:_elem, a-done?:bool <span class="Special"><-</span> call k1 <span id="L37" class="LineNr">37 </span> <span class="Conceal">¦</span> k2, y:_elem, b-done?:bool <span class="Special"><-</span> call k2 @@ -109,10 +109,10 @@ if ('onhashchange' in window) { <span id="L48" class="LineNr">48 </span><span class="muRecipe">def</span> <a href='same-fringe.mu.html#L48'>process</a> t:&:<a href='same-fringe.mu.html#L9'>tree</a>:_elem [ <span id="L49" class="LineNr">49 </span> <span class="Constant">local-scope</span> <span id="L50" class="LineNr">50 </span> <span class="Constant">load-inputs</span> -<span id="L51" class="LineNr">51 </span> return-continuation-until-mark <span class="Constant">100/mark</span> <span class="Comment"># initial</span> +<span id="L51" class="LineNr">51 </span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span> <span class="Comment"># initial</span> <span id="L52" class="LineNr">52 </span> <a href='same-fringe.mu.html#L59'>traverse</a> t <span id="L53" class="LineNr">53 </span> zero-val:&:_elem <span class="Special"><-</span> new <span class="Constant">_elem:type</span> -<span id="L54" class="LineNr">54 </span> return-continuation-until-mark <span class="Constant">100/mark</span>, *zero-val, <span class="Constant">1/done</span> <span class="Comment"># final</span> +<span id="L54" class="LineNr">54 </span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span>, *zero-val, <span class="Constant">1/done</span> <span class="Comment"># final</span> <span id="L55" class="LineNr">55 </span> assert <span class="Constant">0/false</span>, <span class="Constant">[continuation called past done]</span> <span id="L56" class="LineNr">56 </span>] <span id="L57" class="LineNr">57 </span> @@ -129,7 +129,7 @@ if ('onhashchange' in window) { <span id="L68" class="LineNr">68 </span> <span class="muControl">return-if</span> r <span id="L69" class="LineNr">69 </span> <span class="Comment"># leaf</span> <span id="L70" class="LineNr">70 </span> v:_elem <span class="Special"><-</span> get *t, <span class="Constant">val:offset</span> -<span id="L71" class="LineNr">71 </span> return-continuation-until-mark <span class="Constant">100/mark</span>, v, <span class="Constant">0/not-done</span> +<span id="L71" class="LineNr">71 </span> <span class="muControl">return-continuation-until-mark</span> <span class="Constant">100/mark</span>, v, <span class="Constant">0/not-done</span> <span id="L72" class="LineNr">72 </span>] <span id="L73" class="LineNr">73 </span> <span id="L74" class="LineNr">74 </span><span class="Comment"># details</span> |