From dbe124108b7a3529feeeba91339928c4ac737072 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 23 Jun 2015 14:02:12 -0700 Subject: 1631 - update html versions Html is a little more readable thanks to feedback from J David Eisenberg (https://news.ycombinator.com/item?id=9766330), in particular the suggestion to use https://addons.mozilla.org/En-us/firefox/addon/wcag-contrast-checker. --- html/061channel.mu.html | 50 ++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'html/061channel.mu.html') diff --git a/html/061channel.mu.html b/html/061channel.mu.html index 4122d241..42ffdada 100644 --- a/html/061channel.mu.html +++ b/html/061channel.mu.html @@ -12,15 +12,15 @@ @@ -45,7 +45,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } scenario channel [ run [ - 1:address:channel <- init-channel 3:literal/capacity + 1:address:channel <- new-channel 3:literal/capacity 1:address:channel <- write 1:address:channel, 34:literal 2:number, 1:address:channel <- read 1:address:channel ] @@ -66,8 +66,8 @@ container channel [ data:address:array:location ] -# result:address:channel <- init-channel capacity:number -recipe init-channel [ +# result:address:channel <- new-channel capacity:number +recipe new-channel [ default-space:address:array:location <- new location:type, 30:literal # result = new channel result:address:channel <- new channel:type @@ -154,7 +154,7 @@ container channel [ scenario channel-initialization [ run [ - 1:address:channel <- init-channel 3:literal/capacity + 1:address:channel <- new-channel 3:literal/capacity 2:number <- get 1:address:channel/deref, first-full:offset 3:number <- get 1:address:channel/deref, first-free:offset ] @@ -166,7 +166,7 @@ container channel [ scenario channel-write-increments-free [ run [ - 1:address:channel <- init-channel 3:literal/capacity + 1:address:channel <- new-channel 3:literal/capacity 1:address:channel <- write 1:address:channel, 34:literal 2:number <- get 1:address:channel/deref, first-full:offset 3:number <- get 1:address:channel/deref, first-free:offset @@ -179,7 +179,7 @@ container channel [ scenario channel-read-increments-full [ run [ - 1:address:channel <- init-channel 3:literal/capacity + 1:address:channel <- new-channel 3:literal/capacity 1:address:channel <- write 1:address:channel, 34:literal _, 1:address:channel <- read 1:address:channel 2:number <- get 1:address:channel/deref, first-full:offset @@ -194,7 +194,7 @@ container channel [ scenario channel-wrap [ run [ # channel with just 1 slot - 1:address:channel <- init-channel 1:literal/capacity + 1:address:channel <- new-channel 1:literal/capacity # write and read a value 1:address:channel <- write 1:address:channel, 34:literal _, 1:address:channel <- read 1:address:channel @@ -261,7 +261,7 @@ container channel [ scenario channel-new-empty-not-full [ run [ - 1:address:channel <- init-channel 3:literal/capacity + 1:address:channel <- new-channel 3:literal/capacity 2:boolean <- channel-empty? 1:address:channel 3:boolean <- channel-full? 1:address:channel ] @@ -273,7 +273,7 @@ container channel [ scenario channel-write-not-empty [ run [ - 1:address:channel <- init-channel 3:literal/capacity + 1:address:channel <- new-channel 3:literal/capacity 1:address:channel <- write 1:address:channel, 34:literal 2:boolean <- channel-empty? 1:address:channel 3:boolean <- channel-full? 1:address:channel @@ -286,7 +286,7 @@ container channel [ scenario channel-write-full [ run [ - 1:address:channel <- init-channel 1:literal/capacity + 1:address:channel <- new-channel 1:literal/capacity 1:address:channel <- write 1:address:channel, 34:literal 2:boolean <- channel-empty? 1:address:channel 3:boolean <- channel-full? 1:address:channel @@ -299,7 +299,7 @@ container channel [ scenario channel-read-not-full [ run [ - 1:address:channel <- init-channel 1:literal/capacity + 1:address:channel <- new-channel 1:literal/capacity 1:address:channel <- write 1:address:channel, 34:literal _, 1:address:channel <- read 1:address:channel 2:boolean <- channel-empty? 1:address:channel @@ -321,7 +321,7 @@ container channel [ out:address:channel <- next-ingredient # repeat forever { - line:address:buffer <- init-buffer, 30:literal + line:address:buffer <- new-buffer, 30:literal # read characters from 'in' until newline, copy into line { +next-character @@ -332,7 +332,7 @@ container channel [ backspace?:boolean <- equal c:character, 8:literal break-unless backspace?:boolean # drop previous character -#? return-to-console #? 2 +#? close-console #? 2 #? $print [backspace! #? 1 #? ] #? 1 { @@ -355,12 +355,12 @@ container channel [ line:address:buffer <- buffer-append line:address:buffer, c:character line-done?:boolean <- equal c:character, 10:literal/newline break-if line-done?:boolean - # stop buffering on eof (currently only generated by fake keyboard) - empty-fake-keyboard?:boolean <- equal c:character, 0:literal/eof - break-if empty-fake-keyboard?:boolean + # stop buffering on eof (currently only generated by fake console) + eof?:boolean <- equal c:character, 0:literal/eof + break-if eof?:boolean loop } -#? return-to-console #? 1 +#? close-console #? 1 # copy line into 'out' #? $print [buffer-lines: emitting #? ] @@ -386,8 +386,8 @@ container channel [ scenario buffer-lines-blocks-until-newline [ run [ - 1:address:channel/stdin <- init-channel 10:literal/capacity - 2:address:channel/buffered-stdin <- init-channel 10:literal/capacity + 1:address:channel/stdin <- new-channel 10:literal/capacity + 2:address:channel/buffered-stdin <- new-channel 10:literal/capacity 3:boolean <- channel-empty? 2:address:channel/buffered-stdin assert 3:boolean, [ F buffer-lines-blocks-until-newline: channel should be empty after init] -- cgit 1.4.1-2-gfad0