From 6c52e24e2996a77aa6297b26159003d503aef8a0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 18 Apr 2017 11:33:33 -0700 Subject: 3830 - crosslink shape-shifting containers in html --- html/061text.mu.html | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'html/061text.mu.html') diff --git a/html/061text.mu.html b/html/061text.mu.html index 0a5b7a4e..bc269d39 100644 --- a/html/061text.mu.html +++ b/html/061text.mu.html @@ -185,12 +185,12 @@ if ('onhashchange' in window) { 123 ] 124 125 # A new type to help incrementally construct texts. - 126 container buffer:_elem [ + 126 container buffer:_elem [ 127 length:num 128 data:&:@:_elem 129 ] 130 - 131 def new-buffer capacity:num -> result:&:buffer:_elem [ + 131 def new-buffer capacity:num -> result:&:buffer:_elem [ 132 local-scope 133 load-ingredients 134 result <- new {(buffer _elem): type} @@ -205,7 +205,7 @@ if ('onhashchange' in window) { 143 return result 144 ] 145 - 146 def grow-buffer buf:&:buffer:_elem -> buf:&:buffer:_elem [ + 146 def grow-buffer buf:&:buffer:_elem -> buf:&:buffer:_elem [ 147 local-scope 148 load-ingredients 149 # double buffer size @@ -226,7 +226,7 @@ if ('onhashchange' in window) { 164 } 165 ] 166 - 167 def buffer-full? in:&:buffer:_elem -> result:bool [ + 167 def buffer-full? in:&:buffer:_elem -> result:bool [ 168 local-scope 169 load-ingredients 170 len:num <- get *in, length:offset @@ -236,7 +236,7 @@ if ('onhashchange' in window) { 174 ] 175 176 # most broadly applicable definition of append to a buffer: just call to-text - 177 def append buf:&:buffer:char, x:_elem -> buf:&:buffer:char [ + 177 def append buf:&:buffer:char, x:_elem -> buf:&:buffer:char [ 178 local-scope 179 load-ingredients 180 text:text <- to-text x @@ -252,7 +252,7 @@ if ('onhashchange' in window) { 190 } 191 ] 192 - 193 def append buf:&:buffer:char, c:char -> buf:&:buffer:char [ + 193 def append buf:&:buffer:char, c:char -> buf:&:buffer:char [ 194 local-scope 195 load-ingredients 196 len:num <- get *buf, length:offset @@ -278,7 +278,7 @@ if ('onhashchange' in window) { 216 *buf <- put *buf, length:offset, len 217 ] 218 - 219 def append buf:&:buffer:char, t:text -> buf:&:buffer:char [ + 219 def append buf:&:buffer:char, t:text -> buf:&:buffer:char [ 220 local-scope 221 load-ingredients 222 len:num <- length *t @@ -295,7 +295,7 @@ if ('onhashchange' in window) { 233 234 scenario append-to-empty-buffer [ 235 local-scope - 236 x:&:buffer:char <- new-buffer + 236 x:&:buffer:char <- new-buffer 237 run [ 238 ¦ c:char <- copy 97/a 239 ¦ x <- append x, c @@ -313,7 +313,7 @@ if ('onhashchange' in window) { 251 252 scenario append-to-buffer [ 253 local-scope - 254 x:&:buffer:char <- new-buffer + 254 x:&:buffer:char <- new-buffer 255 c:char <- copy 97/a 256 x <- append x, c 257 run [ @@ -335,7 +335,7 @@ if ('onhashchange' in window) { 273 274 scenario append-grows-buffer [ 275 local-scope - 276 x:&:buffer:char <- new-buffer 3 + 276 x:&:buffer:char <- new-buffer 3 277 s1:text <- get *x, data:offset 278 x <- append x, [abc] # buffer is now full 279 s2:text <- get *x, data:offset @@ -372,7 +372,7 @@ if ('onhashchange' in window) { 310 311 scenario buffer-append-handles-backspace [ 312 local-scope - 313 x:&:buffer:char <- new-buffer + 313 x:&:buffer:char <- new-buffer 314 x <- append x, [ab] 315 run [ 316 ¦ c:char <- copy 8/backspace @@ -387,7 +387,7 @@ if ('onhashchange' in window) { 325 ] 326 ] 327 - 328 def buffer-to-array in:&:buffer:_elem -> result:&:@:_elem [ + 328 def buffer-to-array in:&:buffer:_elem -> result:&:@:_elem [ 329 local-scope 330 load-ingredients 331 { @@ -421,7 +421,7 @@ if ('onhashchange' in window) { 359 def append first:text -> result:text [ 360 local-scope 361 load-ingredients - 362 buf:&:buffer:char <- new-buffer 30 + 362 buf:&:buffer:char <- new-buffer 30 363 # append first ingredient 364 { 365 ¦ break-unless first -- cgit 1.4.1-2-gfad0