about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-11-27 11:34:27 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-11-27 11:34:27 -0800
commit91610795155d24b730944056695598753b9d214f (patch)
tree2d4782c2f7c8891246afcdea608afcacd9093eee
parentc0f43700384b149d9fa1e089600c01a81c7a851e (diff)
downloadmu-91610795155d24b730944056695598753b9d214f.tar.gz
2477
-rw-r--r--070text.mu9
-rw-r--r--081print.mu2
-rw-r--r--edit/005-sandbox.mu4
-rw-r--r--sandbox/005-sandbox.mu4
4 files changed, 9 insertions, 10 deletions
diff --git a/070text.mu b/070text.mu
index 40243496..2b0e41b7 100644
--- a/070text.mu
+++ b/070text.mu
@@ -224,8 +224,7 @@ scenario buffer-append-handles-backspace [
   ]
 ]
 
-# result:address:array:character <- integer-to-decimal-text n:number
-recipe integer-to-decimal-text n:number -> result:address:array:character [
+recipe to-text n:number -> result:address:array:character [
   local-scope
   load-ingredients
   # is n zero?
@@ -304,7 +303,7 @@ recipe buffer-to-array in:address:buffer -> result:address:array:character [
 
 scenario integer-to-decimal-digit-zero [
   run [
-    1:address:array:character/raw <- integer-to-decimal-text 0
+    1:address:array:character/raw <- to-text 0
     2:array:character/raw <- copy *1:address:array:character/raw
   ]
   memory-should-contain [
@@ -314,7 +313,7 @@ scenario integer-to-decimal-digit-zero [
 
 scenario integer-to-decimal-digit-positive [
   run [
-    1:address:array:character/raw <- integer-to-decimal-text 234
+    1:address:array:character/raw <- to-text 234
     2:array:character/raw <- copy *1:address:array:character/raw
   ]
   memory-should-contain [
@@ -324,7 +323,7 @@ scenario integer-to-decimal-digit-positive [
 
 scenario integer-to-decimal-digit-negative [
   run [
-    1:address:array:character/raw <- integer-to-decimal-text -1
+    1:address:array:character/raw <- to-text -1
     2:array:character/raw <- copy *1:address:array:character/raw
   ]
   memory-should-contain [
diff --git a/081print.mu b/081print.mu
index 482d6da8..af49b012 100644
--- a/081print.mu
+++ b/081print.mu
@@ -656,6 +656,6 @@ recipe print-integer screen:address:screen, n:number -> screen:address:screen [
     bg-color <- copy 0/black
   }
   # todo: other bases besides decimal
-  s:address:array:character <- integer-to-decimal-text n
+  s:address:array:character <- to-text n
   screen <- print screen, s, color, bg-color
 ]
diff --git a/edit/005-sandbox.mu b/edit/005-sandbox.mu
index 81292b3b..15c6ef98 100644
--- a/edit/005-sandbox.mu
+++ b/edit/005-sandbox.mu
@@ -209,7 +209,7 @@ recipe save-sandboxes env:address:programming-environment-data [
   {
     break-unless curr
     data:address:array:character <- get *curr, data:offset
-    filename:address:array:character <- integer-to-decimal-text idx
+    filename:address:array:character <- to-text idx
     save filename, data
     {
       expected-response:address:array:character <- get *curr, expected-response:offset
@@ -296,7 +296,7 @@ recipe restore-sandboxes env:address:programming-environment-data -> env:address
   idx:number <- copy 0
   curr:address:address:sandbox-data <- get-address *env, sandbox:offset
   {
-    filename:address:array:character <- integer-to-decimal-text idx
+    filename:address:array:character <- to-text idx
     contents:address:array:character <- restore filename
     break-unless contents  # stop at first error; assuming file didn't exist
     # create new sandbox for file
diff --git a/sandbox/005-sandbox.mu b/sandbox/005-sandbox.mu
index ddffd14a..da5bd54c 100644
--- a/sandbox/005-sandbox.mu
+++ b/sandbox/005-sandbox.mu
@@ -192,7 +192,7 @@ recipe save-sandboxes env:address:programming-environment-data [
   {
     break-unless curr
     data:address:array:character <- get *curr, data:offset
-    filename:address:array:character <- integer-to-decimal-text idx
+    filename:address:array:character <- to-text idx
     save filename, data
     {
       expected-response:address:array:character <- get *curr, expected-response:offset
@@ -280,7 +280,7 @@ recipe restore-sandboxes env:address:programming-environment-data -> env:address
   idx:number <- copy 0
   curr:address:address:sandbox-data <- get-address *env, sandbox:offset
   {
-    filename:address:array:character <- integer-to-decimal-text idx
+    filename:address:array:character <- to-text idx
     contents:address:array:character <- restore filename
     break-unless contents  # stop at first error; assuming file didn't exist
     # create new sandbox for file