about summary refs log tree commit diff stats
path: root/html/062array.mu.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-07-29 15:55:05 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-07-29 15:55:05 -0700
commit9570363aec35e187e2395b1760a4b94e71580ac9 (patch)
tree5b0d9cf65b5d5a403ab29e88535ba158efb276fe /html/062array.mu.html
parentb318b7fb127a2bdf3e394b315a45d339dc738447 (diff)
downloadmu-9570363aec35e187e2395b1760a4b94e71580ac9.tar.gz
1885
Diffstat (limited to 'html/062array.mu.html')
-rw-r--r--html/062array.mu.html38
1 files changed, 19 insertions, 19 deletions
diff --git a/html/062array.mu.html b/html/062array.mu.html
index 50b72162..55169dfe 100644
--- a/html/062array.mu.html
+++ b/html/062array.mu.html
@@ -15,11 +15,11 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
 * { font-size: 1.05em; }
 .muScenario { color: #00af00; }
 .Delimiter { color: #a04060; }
+.muRecipe { color: #ff8700; }
 .Comment { color: #9090ff; }
 .Constant { color: #00a0a0; }
 .Special { color: #ff6060; }
 .muControl { color: #c0a020; }
-.muRecipe { color: #ff8700; }
 -->
 </style>
 
@@ -33,43 +33,43 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; }
 <pre id='vimCodeElement'>
 <span class="muScenario">scenario</span> array-from-args [
   run [
-    1:address:array:location<span class="Special"> &lt;- </span>new-array <span class="Constant">0:literal</span>, <span class="Constant">1:literal</span>, <span class="Constant">2:literal</span>
-    2:array:location<span class="Special"> &lt;- </span>copy 1:address:array:location/deref
+    <span class="Constant">1</span>:address:array:location<span class="Special"> &lt;- </span>new-array <span class="Constant">0</span>, <span class="Constant">1</span>, <span class="Constant">2</span>
+    <span class="Constant">2</span>:array:location<span class="Special"> &lt;- </span>copy *<span class="Constant">1</span>:address:array:location
   ]
   memory-should-contain [
-    2<span class="Special"> &lt;- </span>3  <span class="Comment"># array length</span>
-    3<span class="Special"> &lt;- </span>0
-    4<span class="Special"> &lt;- </span>1
-    5<span class="Special"> &lt;- </span>2
+    <span class="Constant">2</span><span class="Special"> &lt;- </span><span class="Constant">3</span>  <span class="Comment"># array length</span>
+    <span class="Constant">3</span><span class="Special"> &lt;- </span><span class="Constant">0</span>
+    <span class="Constant">4</span><span class="Special"> &lt;- </span><span class="Constant">1</span>
+    <span class="Constant">5</span><span class="Special"> &lt;- </span><span class="Constant">2</span>
   ]
 ]
 
 <span class="Comment"># create an array out of a list of scalar args</span>
 <span class="muRecipe">recipe</span> new-array [
   <span class="Constant">local-scope</span>
-  capacity:number<span class="Special"> &lt;- </span>copy <span class="Constant">0:literal</span>
+  capacity:number<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
   <span class="Delimiter">{</span>
     <span class="Comment"># while read curr-value</span>
     curr-value:location, exists?:boolean<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
-    <span class="muControl">break-unless</span> exists?:boolean
-    capacity:number<span class="Special"> &lt;- </span>add capacity:number, <span class="Constant">1:literal</span>
+    <span class="muControl">break-unless</span> exists?
+    capacity<span class="Special"> &lt;- </span>add capacity, <span class="Constant">1</span>
     <span class="muControl">loop</span>
   <span class="Delimiter">}</span>
-  result:address:array:location<span class="Special"> &lt;- </span>new location:type, capacity:number
+  result:address:array:location<span class="Special"> &lt;- </span>new location:type, capacity
   rewind-ingredients
-  i:number<span class="Special"> &lt;- </span>copy <span class="Constant">0:literal</span>
+  i:number<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
   <span class="Delimiter">{</span>
     <span class="Comment"># while read curr-value</span>
-    done?:boolean<span class="Special"> &lt;- </span>greater-or-equal i:number, capacity:number
-    <span class="muControl">break-if</span> done?:boolean
+    done?:boolean<span class="Special"> &lt;- </span>greater-or-equal i, capacity
+    <span class="muControl">break-if</span> done?
     curr-value:location, exists?:boolean<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
-    assert exists?:boolean, <span class="Constant">[error in rewinding ingredients to new-array]</span>
-    tmp:address:location<span class="Special"> &lt;- </span>index-address result:address:array:location/deref, i:number
-    tmp:address:location/deref<span class="Special"> &lt;- </span>copy curr-value:location
-    i:number<span class="Special"> &lt;- </span>add i:number, <span class="Constant">1:literal</span>
+    assert exists?, <span class="Constant">[error in rewinding ingredients to new-array]</span>
+    tmp:address:location<span class="Special"> &lt;- </span>index-address *result, i
+    *tmp<span class="Special"> &lt;- </span>copy curr-value
+    i<span class="Special"> &lt;- </span>add i, <span class="Constant">1</span>
     <span class="muControl">loop</span>
   <span class="Delimiter">}</span>
-  <span class="muControl">reply</span> result:address:array:location
+  <span class="muControl">reply</span> result
 ]
 </pre>
 </body>