about summary refs log tree commit diff stats
path: root/038new_text.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-17 00:06:04 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-17 00:06:04 -0700
commit7c9def3c5a35c07afdc95b383d6ff85a7c16ef0b (patch)
treec69ae0c6ec4fca45e23eed42ffbcce5fdbc71eae /038new_text.cc
parent14b0932a54916349b531e804acc34a1c3caf70cf (diff)
downloadmu-7c9def3c5a35c07afdc95b383d6ff85a7c16ef0b.tar.gz
3376 - start maximally using all type abbreviations
It might be too much, particularly if students start peeking inside .mu
files early. But worth a shot for not just to iron out the kinks in the
abbreviation system.
Diffstat (limited to '038new_text.cc')
-rw-r--r--038new_text.cc28
1 files changed, 14 insertions, 14 deletions
diff --git a/038new_text.cc b/038new_text.cc
index 9ecc992c..d9dbbf17 100644
--- a/038new_text.cc
+++ b/038new_text.cc
@@ -6,17 +6,17 @@ put(Type_abbreviations, "text", new_type_tree("address:array:character"));
 
 :(scenario new_string)
 def main [
-  1:address:array:character <- new [abc def]
-  2:character <- index *1:address:array:character, 5
+  1:text <- new [abc def]
+  2:character <- index *1:text, 5
 ]
 # number code for 'e'
 +mem: storing 101 in location 2
 
 :(scenario new_string_handles_unicode)
 def main [
-  1:address:array:character <- new [a«c]
-  2:number <- length *1:address:array:character
-  3:character <- index *1:address:array:character, 1
+  1:text <- new [a«c]
+  2:number <- length *1:text
+  3:character <- index *1:text, 1
 ]
 +mem: storing 3 in location 2
 # unicode for '«'
@@ -66,8 +66,8 @@ int new_mu_text(const string& contents) {
 
 :(scenario stash_string)
 def main [
-  1:address:array:character <- new [abc]
-  stash [foo:], 1:address:array:character
+  1:text <- new [abc]
+  stash [foo:], 1:text
 ]
 +app: foo: abc
 
@@ -79,22 +79,22 @@ if (is_mu_text(r)) {
 
 :(scenario unicode_string)
 def main [
-  1:address:array:character <- new [♠]
-  stash [foo:], 1:address:array:character
+  1:text <- new [♠]
+  stash [foo:], 1:text
 ]
 +app: foo: ♠
 
 :(scenario stash_space_after_string)
 def main [
-  1:address:array:character <- new [abc]
-  stash 1:address:array:character, [foo]
+  1:text <- new [abc]
+  stash 1:text, [foo]
 ]
 +app: abc foo
 
 :(scenario stash_string_as_array)
 def main [
-  1:address:array:character <- new [abc]
-  stash *1:address:array:character
+  1:text <- new [abc]
+  stash *1:text
 ]
 +app: 3 97 98 99
 
@@ -107,7 +107,7 @@ if (!canonize_type(x)) return false;
 % Initial_memory_per_routine = 3;
 def main [
   1:address:number/raw <- new number:type
-  2:address:array:character/raw <- new [a]  # not enough room in initial page, if you take the refcount and array length into account
+  2:text/raw <- new [a]  # not enough room in initial page, if you take the refcount and array length into account
 ]
 +new: routine allocated memory from 1000 to 1003
 +new: routine allocated memory from 1003 to 1006