From 32b8fac2799ac7cec613e84a3eb9c009141b6a3a Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 25 Apr 2016 22:27:19 -0700 Subject: 2866 --- html/073array.mu.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'html/073array.mu.html') diff --git a/html/073array.mu.html b/html/073array.mu.html index 8cafa8d5..433e2044 100644 --- a/html/073array.mu.html +++ b/html/073array.mu.html @@ -33,8 +33,8 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 scenario array-from-args [
   run [
-    1:address:shared:array:character <- new-array 0, 1, 2
-    2:array:character <- copy *1:address:shared:array:character
+    1:address:array:character <- new-array 0, 1, 2
+    2:array:character <- copy *1:address:array:character
   ]
   memory-should-contain [
     2 <- 3  # array length
@@ -45,7 +45,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
 ]
 
 # create an array out of a list of scalar args
-def new-array -> result:address:shared:array:character [
+def new-array -> result:address:array:character [
   local-scope
   capacity:number <- copy 0
   {
@@ -56,7 +56,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
     loop
   }
   result <- new character:type, capacity
-  rewind-ingredients
+  rewind-ingredients
   i:number <- copy 0
   {
     # while read curr-value
@@ -64,8 +64,7 @@ body { font-size: 12pt; font-family: monospace; color: #eeeeee; background-color
     break-if done?
     curr-value:character, exists?:boolean <- next-ingredient
     assert exists?, [error in rewinding ingredients to new-array]
-    tmp:address:character <- index-address *result, i
-    *tmp <- copy curr-value
+    *result <- put-index *result, i, curr-value
     i <- add i, 1
     loop
   }
-- 
cgit 1.4.1-2-gfad0