From 0ca56ed853c3d9bc8c26d1b014d8b665363fc2d0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Thu, 15 Sep 2016 01:01:58 -0700 Subject: 3355 --- html/061text.mu.html | 289 ++++++++++++++++++++++++--------------------------- 1 file changed, 137 insertions(+), 152 deletions(-) (limited to 'html/061text.mu.html') diff --git a/html/061text.mu.html b/html/061text.mu.html index 268d4275..e1a99fc8 100644 --- a/html/061text.mu.html +++ b/html/061text.mu.html @@ -34,22 +34,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 # Some useful helpers for dealing with text (arrays of characters)
 
-# to-text-line gets called implicitly in various places
-# define it to be identical to 'to-text' by default
-def to-text-line x:_elem -> y:address:array:character [
-  local-scope
-  load-ingredients
-  y <- to-text x
-]
-
-# variant for arrays (since we can't pass them around otherwise)
-def array-to-text-line x:address:array:_elem -> y:address:array:character [
-  local-scope
-  load-ingredients
-  y <- to-text *x
-]
-
-def equal a:address:array:character, b:address:array:character -> result:boolean [
+def equal a:text, b:text -> result:boolean [
   local-scope
   load-ingredients
   a-len:number <- length *a
@@ -83,7 +68,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-equal-reflexive [
   run [
     local-scope
-    x:address:array:character <- new [abc]
+    x:text <- new [abc]
     10:boolean/raw <- equal x, x
   ]
   memory-should-contain [
@@ -94,8 +79,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-equal-identical [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new [abc]
+    x:text <- new [abc]
+    y:text <- new [abc]
     10:boolean/raw <- equal x, y
   ]
   memory-should-contain [
@@ -106,8 +91,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-equal-distinct-lengths [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new [abcd]
+    x:text <- new [abc]
+    y:text <- new [abcd]
     10:boolean/raw <- equal x, y
   ]
   memory-should-contain [
@@ -124,8 +109,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-equal-with-empty [
   run [
     local-scope
-    x:address:array:character <- new []
-    y:address:array:character <- new [abcd]
+    x:text <- new []
+    y:text <- new [abcd]
     10:boolean/raw <- equal x, y
   ]
   memory-should-contain [
@@ -136,8 +121,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-equal-common-lengths-but-distinct [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new [abd]
+    x:text <- new [abc]
+    y:text <- new [abd]
     10:boolean/raw <- equal x, y
   ]
   memory-should-contain [
@@ -148,7 +133,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 # A new type to help incrementally construct texts.
 container buffer [
   length:number
-  data:address:array:character
+  data:text
 ]
 
 def new-buffer capacity:number -> result:address:buffer [
@@ -161,7 +146,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
     # capacity not provided
     capacity <- copy 10
   }
-  data:address:array:character <- new character:type, capacity
+  data:text <- new character:type, capacity
   *result <- put *result, data:offset, data
   return result
 ]
@@ -170,10 +155,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   local-scope
   load-ingredients
   # double buffer size
-  olddata:address:array:character <- get *in, data:offset
+  olddata:text <- get *in, data:offset
   oldlen:number <- length *olddata
   newlen:number <- multiply oldlen, 2
-  newdata:address:array:character <- new character:type, newlen
+  newdata:text <- new character:type, newlen
   *in <- put *in, data:offset, newdata
   # copy old contents
   i:number <- copy 0
@@ -191,7 +176,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   local-scope
   load-ingredients
   len:number <- get *in, length:offset
-  s:address:array:character <- get *in, data:offset
+  s:text <- get *in, data:offset
   capacity:number <- length *s
   result <- greater-or-equal len, capacity
 ]
@@ -200,7 +185,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 def append buf:address:buffer, x:_elem -> buf:address:buffer [
   local-scope
   load-ingredients
-  text:address:array:character <- to-text x
+  text:text <- to-text x
   len:number <- length *text
   i:number <- copy 0
   {
@@ -233,7 +218,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
     break-unless full?
     in <- grow-buffer in
   }
-  s:address:array:character <- get *in, data:offset
+  s:text <- get *in, data:offset
   *s <- put-index *s, len, c
   len <- add len, 1
   *in <- put *in, length:offset, len
@@ -243,20 +228,20 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   run [
     local-scope
     x:address:buffer <- new-buffer 3
-    s1:address:array:character <- get *x, data:offset
+    s1:text <- get *x, data:offset
     c:character <- copy 97/a
     x <- append x, c
     c:character <- copy 98/b
     x <- append x, c
     c:character <- copy 99/c
     x <- append x, c
-    s2:address:array:character <- get *x, data:offset
+    s2:text <- get *x, data:offset
     10:boolean/raw <- equal s1, s2
     11:array:character/raw <- copy *s2
     +buffer-filled
     c:character <- copy 100/d
     x <- append x, c
-    s3:address:array:character <- get *x, data:offset
+    s3:text <- get *x, data:offset
     20:boolean/raw <- equal s1, s3
     21:number/raw <- get *x, length:offset
     30:array:character/raw <- copy *s3
@@ -300,7 +285,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
     x <- append x, c
     c:character <- copy 8/backspace
     x <- append x, c
-    s:address:array:character <- buffer-to-array x
+    s:text <- buffer-to-array x
     10:array:character/raw <- copy *s
   ]
   memory-should-contain [
@@ -310,7 +295,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   ]
 ]
 
-def buffer-to-array in:address:buffer -> result:address:array:character [
+def buffer-to-array in:address:buffer -> result:text [
   local-scope
   load-ingredients
   {
@@ -319,7 +304,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
     return 0
   }
   len:number <- get *in, length:offset
-  s:address:array:character <- get *in, data:offset
+  s:text <- get *in, data:offset
   # we can't just return s because it is usually the wrong length
   result <- new character:type, len
   i:number <- copy 0
@@ -333,7 +318,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   }
 ]
 
-def append a:address:array:character, b:address:array:character -> result:address:array:character [
+def append a:text, b:text -> result:text [
   local-scope
   load-ingredients
   # handle null addresses
@@ -376,9 +361,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-append-1 [
   run [
     local-scope
-    x:address:array:character <- new [hello,]
-    y:address:array:character <- new [ world!]
-    z:address:array:character <- append x, y
+    x:text <- new [hello,]
+    y:text <- new [ world!]
+    z:text <- append x, y
     10:array:character/raw <- copy *z
   ]
   memory-should-contain [
@@ -389,9 +374,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-append-null [
   run [
     local-scope
-    x:address:array:character <- copy 0
-    y:address:array:character <- new [ world!]
-    z:address:array:character <- append x, y
+    x:text <- copy 0
+    y:text <- new [ world!]
+    z:text <- append x, y
     10:array:character/raw <- copy *z
   ]
   memory-should-contain [
@@ -402,9 +387,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-append-null-2 [
   run [
     local-scope
-    x:address:array:character <- new [hello,]
-    y:address:array:character <- copy 0
-    z:address:array:character <- append x, y
+    x:text <- new [hello,]
+    y:text <- copy 0
+    z:text <- append x, y
     10:array:character/raw <- copy *z
   ]
   memory-should-contain [
@@ -415,7 +400,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario replace-character-in-text [
   run [
     local-scope
-    x:address:array:character <- new [abc]
+    x:text <- new [abc]
     x <- replace x, 98/b, 122/z
     10:array:character/raw <- copy *x
   ]
@@ -424,7 +409,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   ]
 ]
 
-def replace s:address:array:character, oldc:character, newc:character, from:number/optional -> s:address:array:character [
+def replace s:text, oldc:character, newc:character, from:number/optional -> s:text [
   local-scope
   load-ingredients
   len:number <- length *s
@@ -439,7 +424,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario replace-character-at-start [
   run [
     local-scope
-    x:address:array:character <- new [abc]
+    x:text <- new [abc]
     x <- replace x, 97/a, 122/z
     10:array:character/raw <- copy *x
   ]
@@ -451,7 +436,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario replace-character-at-end [
   run [
     local-scope
-    x:address:array:character <- new [abc]
+    x:text <- new [abc]
     x <- replace x, 99/c, 122/z
     10:array:character/raw <- copy *x
   ]
@@ -463,7 +448,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario replace-character-missing [
   run [
     local-scope
-    x:address:array:character <- new [abc]
+    x:text <- new [abc]
     x <- replace x, 100/d, 122/z
     10:array:character/raw <- copy *x
   ]
@@ -475,7 +460,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario replace-all-characters [
   run [
     local-scope
-    x:address:array:character <- new [banana]
+    x:text <- new [banana]
     x <- replace x, 97/a, 122/z
     10:array:character/raw <- copy *x
   ]
@@ -485,7 +470,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 ]
 
 # replace underscores in first with remaining args
-def interpolate template:address:array:character -> result:address:array:character [
+def interpolate template:text -> result:text [
   local-scope
   load-ingredients  # consume just the template
   # compute result-len, space to allocate for result
@@ -493,7 +478,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   result-len:number <- copy tem-len
   {
     # while ingredients remain
-    a:address:array:character, arg-received?:boolean <- next-ingredient
+    a:text, arg-received?:boolean <- next-ingredient
     break-unless arg-received?
     # result-len = result-len + arg.length - 1 (for the 'underscore' being replaced)
     a-len:number <- length *a
@@ -509,7 +494,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   i:number <- copy 0
   {
     # while arg received
-    a:address:array:character, arg-received?:boolean <- next-ingredient
+    a:text, arg-received?:boolean <- next-ingredient
     break-unless arg-received?
     # copy template into result until '_'
     {
@@ -561,9 +546,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario interpolate-works [
   run [
     local-scope
-    x:address:array:character <- new [abc_ghi]
-    y:address:array:character <- new [def]
-    z:address:array:character <- interpolate x, y
+    x:text <- new [abc_ghi]
+    y:text <- new [def]
+    z:text <- interpolate x, y
     10:array:character/raw <- copy *z
   ]
   memory-should-contain [
@@ -574,9 +559,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario interpolate-at-start [
   run [
     local-scope
-    x:address:array:character <- new [_, hello!]
-    y:address:array:character <- new [abc]
-    z:address:array:character <- interpolate x, y
+    x:text <- new [_, hello!]
+    y:text <- new [abc]
+    z:text <- interpolate x, y
     10:array:character/raw <- copy *z
   ]
   memory-should-contain [
@@ -587,9 +572,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 
 scenario interpolate-at-end [
   run [
-    x:address:array:character <- new [hello, _]
-    y:address:array:character <- new [abc]
-    z:address:array:character <- interpolate x, y
+    x:text <- new [hello, _]
+    y:text <- new [abc]
+    z:text <- interpolate x, y
     10:array:character/raw <- copy *z
   ]
   memory-should-contain [
@@ -659,7 +644,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   result <- equal c, 12288/ideographic-space
 ]
 
-def trim s:address:array:character -> result:address:array:character [
+def trim s:text -> result:text [
   local-scope
   load-ingredients
   len:number <- length *s
@@ -691,7 +676,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   }
   # result = new character[end+1 - start]
   new-len:number <- subtract end, start, -1
-  result:address:array:character <- new character:type, new-len
+  result:text <- new character:type, new-len
   # copy the untrimmed parts between start and end
   i:number <- copy start
   j:number <- copy 0
@@ -711,8 +696,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario trim-unmodified [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- trim x
+    x:text <- new [abc]
+    y:text <- trim x
     1:array:character/raw <- copy *y
   ]
   memory-should-contain [
@@ -723,8 +708,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario trim-left [
   run [
     local-scope
-    x:address:array:character <- new [  abc]
-    y:address:array:character <- trim x
+    x:text <- new [  abc]
+    y:text <- trim x
     1:array:character/raw <- copy *y
   ]
   memory-should-contain [
@@ -735,8 +720,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario trim-right [
   run [
     local-scope
-    x:address:array:character <- new [abc  ]
-    y:address:array:character <- trim x
+    x:text <- new [abc  ]
+    y:text <- trim x
     1:array:character/raw <- copy *y
   ]
   memory-should-contain [
@@ -747,8 +732,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario trim-left-right [
   run [
     local-scope
-    x:address:array:character <- new [  abc   ]
-    y:address:array:character <- trim x
+    x:text <- new [  abc   ]
+    y:text <- trim x
     1:array:character/raw <- copy *y
   ]
   memory-should-contain [
@@ -759,9 +744,9 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario trim-newline-tab [
   run [
     local-scope
-    x:address:array:character <- new [  abc
+    x:text <- new [ abc
 ]
-    y:address:array:character <- trim x
+    y:text <- trim x
     1:array:character/raw <- copy *y
   ]
   memory-should-contain [
@@ -769,7 +754,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   ]
 ]
 
-def find-next text:address:array:character, pattern:character, idx:number -> next-index:number [
+def find-next text:text, pattern:character, idx:number -> next-index:number [
   local-scope
   load-ingredients
   len:number <- length *text
@@ -788,7 +773,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-find-next [
   run [
     local-scope
-    x:address:array:character <- new [a/b]
+    x:text <- new [a/b]
     10:number/raw <- find-next x, 47/slash, 0/start-index
   ]
   memory-should-contain [
@@ -799,7 +784,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-find-next-empty [
   run [
     local-scope
-    x:address:array:character <- new []
+    x:text <- new []
     10:number/raw <- find-next x, 47/slash, 0/start-index
   ]
   memory-should-contain [
@@ -810,7 +795,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-find-next-initial [
   run [
     local-scope
-    x:address:array:character <- new [/abc]
+    x:text <- new [/abc]
     10:number/raw <- find-next x, 47/slash, 0/start-index
   ]
   memory-should-contain [
@@ -821,7 +806,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-find-next-final [
   run [
     local-scope
-    x:address:array:character <- new [abc/]
+    x:text <- new [abc/]
     10:number/raw <- find-next x, 47/slash, 0/start-index
   ]
   memory-should-contain [
@@ -832,7 +817,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-find-next-missing [
   run [
     local-scope
-    x:address:array:character <- new [abcd]
+    x:text <- new [abcd]
     10:number/raw <- find-next x, 47/slash, 0/start-index
   ]
   memory-should-contain [
@@ -843,7 +828,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-find-next-invalid-index [
   run [
     local-scope
-    x:address:array:character <- new [abc]
+    x:text <- new [abc]
     10:number/raw <- find-next x, 47/slash, 4/start-index
   ]
   memory-should-contain [
@@ -854,7 +839,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-find-next-first [
   run [
     local-scope
-    x:address:array:character <- new [ab/c/]
+    x:text <- new [ab/c/]
     10:number/raw <- find-next x, 47/slash, 0/start-index
   ]
   memory-should-contain [
@@ -865,7 +850,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-find-next-second [
   run [
     local-scope
-    x:address:array:character <- new [ab/c/]
+    x:text <- new [ab/c/]
     10:number/raw <- find-next x, 47/slash, 3/start-index
   ]
   memory-should-contain [
@@ -875,7 +860,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 
 # search for a pattern of multiple characters
 # fairly dumb algorithm
-def find-next text:address:array:character, pattern:address:array:character, idx:number -> next-index:number [
+def find-next text:text, pattern:text, idx:number -> next-index:number [
   local-scope
   load-ingredients
   first:character <- index *pattern, 0
@@ -898,8 +883,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario find-next-text-1 [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new [bc]
+    x:text <- new [abc]
+    y:text <- new [bc]
     10:number/raw <- find-next x, y, 0
   ]
   memory-should-contain [
@@ -910,8 +895,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario find-next-text-2 [
   run [
     local-scope
-    x:address:array:character <- new [abcd]
-    y:address:array:character <- new [bc]
+    x:text <- new [abcd]
+    y:text <- new [bc]
     10:number/raw <- find-next x, y, 1
   ]
   memory-should-contain [
@@ -922,8 +907,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario find-next-no-match [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new [bd]
+    x:text <- new [abc]
+    y:text <- new [bd]
     10:number/raw <- find-next x, y, 0
   ]
   memory-should-contain [
@@ -934,8 +919,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario find-next-suffix-match [
   run [
     local-scope
-    x:address:array:character <- new [abcd]
-    y:address:array:character <- new [cd]
+    x:text <- new [abcd]
+    y:text <- new [cd]
     10:number/raw <- find-next x, y, 0
   ]
   memory-should-contain [
@@ -946,8 +931,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario find-next-suffix-match-2 [
   run [
     local-scope
-    x:address:array:character <- new [abcd]
-    y:address:array:character <- new [cde]
+    x:text <- new [abcd]
+    y:text <- new [cde]
     10:number/raw <- find-next x, y, 0
   ]
   memory-should-contain [
@@ -956,7 +941,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 ]
 
 # checks if pattern matches at index 'idx'
-def match-at text:address:array:character, pattern:address:array:character, idx:number -> result:boolean [
+def match-at text:text, pattern:text, idx:number -> result:boolean [
   local-scope
   load-ingredients
   pattern-len:number <- length *pattern
@@ -990,8 +975,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario match-at-checks-pattern-at-index [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new [ab]
+    x:text <- new [abc]
+    y:text <- new [ab]
     10:boolean/raw <- match-at x, y, 0
   ]
   memory-should-contain [
@@ -1002,7 +987,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario match-at-reflexive [
   run [
     local-scope
-    x:address:array:character <- new [abc]
+    x:text <- new [abc]
     10:boolean/raw <- match-at x, x, 0
   ]
   memory-should-contain [
@@ -1013,8 +998,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario match-at-outside-bounds [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new [a]
+    x:text <- new [abc]
+    y:text <- new [a]
     10:boolean/raw <- match-at x, y, 4
   ]
   memory-should-contain [
@@ -1025,8 +1010,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario match-at-empty-pattern [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new []
+    x:text <- new [abc]
+    y:text <- new []
     10:boolean/raw <- match-at x, y, 0
   ]
   memory-should-contain [
@@ -1037,8 +1022,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario match-at-empty-pattern-outside-bound [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new []
+    x:text <- new [abc]
+    y:text <- new []
     10:boolean/raw <- match-at x, y, 4
   ]
   memory-should-contain [
@@ -1049,8 +1034,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario match-at-empty-text [
   run [
     local-scope
-    x:address:array:character <- new []
-    y:address:array:character <- new [abc]
+    x:text <- new []
+    y:text <- new [abc]
     10:boolean/raw <- match-at x, y, 0
   ]
   memory-should-contain [
@@ -1061,7 +1046,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario match-at-empty-against-empty [
   run [
     local-scope
-    x:address:array:character <- new []
+    x:text <- new []
     10:boolean/raw <- match-at x, x, 0
   ]
   memory-should-contain [
@@ -1072,8 +1057,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario match-at-inside-bounds [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new [bc]
+    x:text <- new [abc]
+    y:text <- new [bc]
     10:boolean/raw <- match-at x, y, 1
   ]
   memory-should-contain [
@@ -1084,8 +1069,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario match-at-inside-bounds-2 [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- new [bc]
+    x:text <- new [abc]
+    y:text <- new [bc]
     10:boolean/raw <- match-at x, y, 0
   ]
   memory-should-contain [
@@ -1093,7 +1078,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   ]
 ]
 
-def split s:address:array:character, delim:character -> result:address:array:address:array:character [
+def split s:text, delim:character -> result:address:array:text [
   local-scope
   load-ingredients
   # empty text? return empty array
@@ -1126,7 +1111,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
     break-if done?
     end:number <- find-next s, delim, start
     # copy start..end into result[curr-result]
-    dest:address:array:character <- copy-range s, start, end
+    dest:text <- copy-range s, start, end
     *result <- put-index *result, curr-result, dest
     # slide over to next slice
     start <- add end, 1
@@ -1138,11 +1123,11 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-split-1 [
   run [
     local-scope
-    x:address:array:character <- new [a/b]
-    y:address:array:address:array:character <- split x, 47/slash
+    x:text <- new [a/b]
+    y:address:array:text <- split x, 47/slash
     10:number/raw <- length *y
-    a:address:array:character <- index *y, 0
-    b:address:array:character <- index *y, 1
+    a:text <- index *y, 0
+    b:text <- index *y, 1
     20:array:character/raw <- copy *a
     30:array:character/raw <- copy *b
   ]
@@ -1156,12 +1141,12 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-split-2 [
   run [
     local-scope
-    x:address:array:character <- new [a/b/c]
-    y:address:array:address:array:character <- split x, 47/slash
+    x:text <- new [a/b/c]
+    y:address:array:text <- split x, 47/slash
     10:number/raw <- length *y
-    a:address:array:character <- index *y, 0
-    b:address:array:character <- index *y, 1
-    c:address:array:character <- index *y, 2
+    a:text <- index *y, 0
+    b:text <- index *y, 1
+    c:text <- index *y, 2
     20:array:character/raw <- copy *a
     30:array:character/raw <- copy *b
     40:array:character/raw <- copy *c
@@ -1177,10 +1162,10 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-split-missing [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:address:array:character <- split x, 47/slash
+    x:text <- new [abc]
+    y:address:array:text <- split x, 47/slash
     10:number/raw <- length *y
-    a:address:array:character <- index *y, 0
+    a:text <- index *y, 0
     20:array:character/raw <- copy *a
   ]
   memory-should-contain [
@@ -1192,8 +1177,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-split-empty [
   run [
     local-scope
-    x:address:array:character <- new []
-    y:address:array:address:array:character <- split x, 47/slash
+    x:text <- new []
+    y:address:array:text <- split x, 47/slash
     10:number/raw <- length *y
   ]
   memory-should-contain [
@@ -1204,13 +1189,13 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-split-empty-piece [
   run [
     local-scope
-    x:address:array:character <- new [a/b//c]
-    y:address:array:address:array:character <- split x:address:array:character, 47/slash
+    x:text <- new [a/b//c]
+    y:address:array:text <- split x:text, 47/slash
     10:number/raw <- length *y
-    a:address:array:character <- index *y, 0
-    b:address:array:character <- index *y, 1
-    c:address:array:character <- index *y, 2
-    d:address:array:character <- index *y, 3
+    a:text <- index *y, 0
+    b:text <- index *y, 1
+    c:text <- index *y, 2
+    d:text <- index *y, 3
     20:array:character/raw <- copy *a
     30:array:character/raw <- copy *b
     40:array:character/raw <- copy *c
@@ -1225,7 +1210,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   ]
 ]
 
-def split-first text:address:array:character, delim:character -> x:address:array:character, y:address:array:character [
+def split-first text:text, delim:character -> x:text, y:text [
   local-scope
   load-ingredients
   # empty text? return empty texts
@@ -1233,21 +1218,21 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   {
     empty?:boolean <- equal len, 0
     break-unless empty?
-    x:address:array:character <- new []
-    y:address:array:character <- new []
+    x:text <- new []
+    y:text <- new []
     return
   }
   idx:number <- find-next text, delim, 0
-  x:address:array:character <- copy-range text, 0, idx
+  x:text <- copy-range text, 0, idx
   idx <- add idx, 1
-  y:address:array:character <- copy-range text, idx, len
+  y:text <- copy-range text, idx, len
 ]
 
 scenario text-split-first [
   run [
     local-scope
-    x:address:array:character <- new [a/b]
-    y:address:array:character, z:address:array:character <- split-first x, 47/slash
+    x:text <- new [a/b]
+    y:text, z:text <- split-first x, 47/slash
     10:array:character/raw <- copy *y
     20:array:character/raw <- copy *z
   ]
@@ -1257,7 +1242,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   ]
 ]
 
-def copy-range buf:address:array:character, start:number, end:number -> result:address:array:character [
+def copy-range buf:text, start:number, end:number -> result:text [
   local-scope
   load-ingredients
   # if end is out of bounds, trim it
@@ -1265,7 +1250,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
   end:number <- min len, end
   # allocate space for result
   len <- subtract end, start
-  result:address:array:character <- new character:type, len
+  result:text <- new character:type, len
   # copy start..end into result[curr-result]
   src-idx:number <- copy start
   dest-idx:number <- copy 0
@@ -1283,8 +1268,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-copy-copies-partial-text [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- copy-range x, 1, 3
+    x:text <- new [abc]
+    y:text <- copy-range x, 1, 3
     1:array:character/raw <- copy *y
   ]
   memory-should-contain [
@@ -1295,8 +1280,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-copy-out-of-bounds [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- copy-range x, 2, 4
+    x:text <- new [abc]
+    y:text <- copy-range x, 2, 4
     1:array:character/raw <- copy *y
   ]
   memory-should-contain [
@@ -1307,8 +1292,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario text-copy-out-of-bounds-2 [
   run [
     local-scope
-    x:address:array:character <- new [abc]
-    y:address:array:character <- copy-range x, 3, 3
+    x:text <- new [abc]
+    y:text <- copy-range x, 3, 3
     1:array:character/raw <- copy *y
   ]
   memory-should-contain [
-- 
cgit 1.4.1-2-gfad0