about summary refs log tree commit diff stats
path: root/html/031address.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-14 16:04:45 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-14 16:04:45 -0700
commit65361948ca7975553757a0e0df4ac7352413044c (patch)
tree22063c089f67cb0d82623f2edc2c16b7e4389d41 /html/031address.cc.html
parent64586540eccbc0880341782d329b419ab9d002de (diff)
downloadmu-65361948ca7975553757a0e0df4ac7352413044c.tar.gz
1376 - update github docs
Diffstat (limited to 'html/031address.cc.html')
-rw-r--r--html/031address.cc.html62
1 files changed, 31 insertions, 31 deletions
diff --git a/html/031address.cc.html b/html/031address.cc.html
index e67afc4c..e54f6df1 100644
--- a/html/031address.cc.html
+++ b/html/031address.cc.html
@@ -2,7 +2,7 @@
 <html>
 <head>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<title>Mu - 031address.cc</title>
+<title>~/Desktop/s/mu/031address.cc</title>
 <meta name="Generator" content="Vim/7.4">
 <meta name="plugin-version" content="vim7.4_v1">
 <meta name="syntax" content="cpp">
@@ -14,12 +14,12 @@ pre { white-space: pre-wrap; font-family: monospace; color: #d0d0d0; background-
 body { font-family: monospace; color: #d0d0d0; background-color: #000000; }
 * { font-size: 1em; }
 .CommentedCode { color: #6c6c6c; }
-.SalientComment { color: #00ffff; }
 .Constant { color: #008080; }
 .Comment { color: #8080ff; }
 .Delimiter { color: #c000c0; }
 .Special { color: #ff6060; }
 .Identifier { color: #008080; }
+.SalientComment { color: #00ffff; }
 .traceContains { color: #008000; }
 -->
 </style>
@@ -37,31 +37,31 @@ body { font-family: monospace; color: #d0d0d0; background-color: #000000; }
 
 <span class="Delimiter">:(scenario copy_indirect)</span>
 recipe main [
-  <span class="Constant">1</span>:address:integer<span class="Special"> &lt;- </span>copy <span class="Constant">2</span>:literal
-  <span class="Constant">2</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>:literal
+  <span class="Constant">1</span>:address:number<span class="Special"> &lt;- </span>copy <span class="Constant">2</span>:literal
+  <span class="Constant">2</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>:literal
   <span class="Comment"># This loads location 1 as an address and looks up *that* location.</span>
-  <span class="Constant">3</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>:address:integer/deref
+  <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">1</span>:address:number/deref
 ]
 <span class="traceContains">+run: instruction main/2</span>
 <span class="traceContains">+mem: location 1 is 2</span>
 <span class="traceContains">+mem: location 2 is 34</span>
 <span class="traceContains">+mem: storing 34 in location 3</span>
 
-<span class="Delimiter">:(before &quot;index_t base = x.value&quot; following &quot;vector&lt;long long int&gt; read_memory(reagent x)&quot;)</span>
+<span class="Delimiter">:(before &quot;index_t base = x.value&quot; following &quot;vector&lt;double&gt; read_memory(reagent x)&quot;)</span>
 x = canonize<span class="Delimiter">(</span>x<span class="Delimiter">);</span>
 
 <span class="Comment">//: similarly, write to addresses pointing at other locations using the</span>
 <span class="Comment">//: 'deref' property</span>
 <span class="Delimiter">:(scenario store_indirect)</span>
 recipe main [
-  <span class="Constant">1</span>:address:integer<span class="Special"> &lt;- </span>copy <span class="Constant">2</span>:literal
-  <span class="Constant">1</span>:address:integer/deref<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>:literal
+  <span class="Constant">1</span>:address:number<span class="Special"> &lt;- </span>copy <span class="Constant">2</span>:literal
+  <span class="Constant">1</span>:address:number/deref<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>:literal
 ]
 <span class="traceContains">+run: instruction main/1</span>
 <span class="traceContains">+mem: location 1 is 2</span>
 <span class="traceContains">+mem: storing 34 in location 2</span>
 
-<span class="Delimiter">:(before &quot;index_t base = x.value&quot; following &quot;void write_memory(reagent x, vector&lt;long long int&gt; data)&quot;)</span>
+<span class="Delimiter">:(before &quot;index_t base = x.value&quot; following &quot;void write_memory(reagent x, vector&lt;double&gt; data)&quot;)</span>
 x = canonize<span class="Delimiter">(</span>x<span class="Delimiter">);</span>
 
 <span class="Delimiter">:(code)</span>
@@ -79,7 +79,7 @@ reagent deref<span class="Delimiter">(</span>reagent x<span class="Delimiter">)<
 <span class="CommentedCode">//?   cout &lt;&lt; &quot;deref: &quot; &lt;&lt; x.to_string() &lt;&lt; &quot;\n&quot;; //? 2</span>
   static const type_number ADDRESS = Type_number[<span class="Constant">&quot;address&quot;</span>]<span class="Delimiter">;</span>
   reagent result<span class="Delimiter">;</span>
-  assert<span class="Delimiter">(</span>x<span class="Delimiter">.</span>types[<span class="Constant">0</span>] == ADDRESS<span class="Delimiter">);</span>
+  assert<span class="Delimiter">(</span>x<span class="Delimiter">.</span>types<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> == ADDRESS<span class="Delimiter">);</span>
 
   <span class="Comment">// compute value</span>
   result<span class="Delimiter">.</span>set_value<span class="Delimiter">(</span>Memory[x<span class="Delimiter">.</span>value]<span class="Delimiter">);</span>
@@ -92,12 +92,12 @@ reagent deref<span class="Delimiter">(</span>reagent x<span class="Delimiter">)<
   index_t i = <span class="Constant">0</span><span class="Delimiter">;</span>
   size_t len = x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>size<span class="Delimiter">();</span>
   for <span class="Delimiter">(</span>i = <span class="Constant">0</span><span class="Delimiter">;</span> i &lt; len<span class="Delimiter">;</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
-    if <span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties[i]<span class="Delimiter">.</span>first == <span class="Constant">&quot;deref&quot;</span><span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
-    result<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties[i]<span class="Delimiter">);</span>
+    if <span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>first == <span class="Constant">&quot;deref&quot;</span><span class="Delimiter">)</span> <span class="Identifier">break</span><span class="Delimiter">;</span>
+    result<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span>
   <span class="Delimiter">}</span>
   ++i<span class="Delimiter">;</span>  <span class="Comment">// skip first deref</span>
   for <span class="Delimiter">(;</span> i &lt; len<span class="Delimiter">;</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
-    result<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties[i]<span class="Delimiter">);</span>
+    result<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>push_back<span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span>
   <span class="Delimiter">}</span>
   <span class="Identifier">return</span> result<span class="Delimiter">;</span>
 <span class="Delimiter">}</span>
@@ -105,26 +105,26 @@ reagent deref<span class="Delimiter">(</span>reagent x<span class="Delimiter">)<
 <span class="SalientComment">//:: 'get' can read from container address</span>
 <span class="Delimiter">:(scenario get_indirect)</span>
 recipe main [
-  <span class="Constant">1</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">2</span>:literal
-  <span class="Constant">2</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>:literal
-  <span class="Constant">3</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">35</span>:literal
-  <span class="Constant">4</span>:integer<span class="Special"> &lt;- </span>get <span class="Constant">1</span>:address:point/deref<span class="Delimiter">,</span> <span class="Constant">0</span>:offset
+  <span class="Constant">1</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">2</span>:literal
+  <span class="Constant">2</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>:literal
+  <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">35</span>:literal
+  <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>get <span class="Constant">1</span>:address:point/deref<span class="Delimiter">,</span> <span class="Constant">0</span>:offset
 ]
 <span class="traceContains">+run: instruction main/3</span>
 <span class="traceContains">+run: address to copy is 2</span>
-<span class="traceContains">+run: product 0 is 34</span>
+<span class="traceContains">+run: product 0 is 4</span>
 <span class="traceContains">+mem: storing 34 in location 4</span>
 
 <span class="Delimiter">:(scenario include_nonderef_properties)</span>
 recipe main [
-  <span class="Constant">1</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">2</span>:literal
-  <span class="Constant">2</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>:literal
-  <span class="Constant">3</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">35</span>:literal
-  <span class="Constant">4</span>:integer<span class="Special"> &lt;- </span>get <span class="Constant">1</span>:address:point/deref/foo<span class="Delimiter">,</span> <span class="Constant">0</span>:offset
+  <span class="Constant">1</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">2</span>:literal
+  <span class="Constant">2</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>:literal
+  <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">35</span>:literal
+  <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>get <span class="Constant">1</span>:address:point/deref/foo<span class="Delimiter">,</span> <span class="Constant">0</span>:offset
 ]
 <span class="traceContains">+run: instruction main/3</span>
 <span class="traceContains">+run: address to copy is 2</span>
-<span class="traceContains">+run: product 0 is 34</span>
+<span class="traceContains">+run: product 0 is 4</span>
 <span class="traceContains">+mem: storing 34 in location 4</span>
 
 <span class="Delimiter">:(after &quot;reagent base = &quot; following &quot;case GET:&quot;)</span>
@@ -133,14 +133,14 @@ base = canonize<span class="Delimiter">(</span>base<span class="Delimiter">);</s
 <span class="Delimiter">:(scenario get_address_indirect)</span>
 <span class="Comment"># 'get' can read from container address</span>
 recipe main [
-  <span class="Constant">1</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">2</span>:literal
-  <span class="Constant">2</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>:literal
-  <span class="Constant">3</span>:integer<span class="Special"> &lt;- </span>copy <span class="Constant">35</span>:literal
-  <span class="Constant">4</span>:integer<span class="Special"> &lt;- </span>get-address <span class="Constant">1</span>:address:point/deref<span class="Delimiter">,</span> <span class="Constant">0</span>:offset
+  <span class="Constant">1</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">2</span>:literal
+  <span class="Constant">2</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">34</span>:literal
+  <span class="Constant">3</span>:number<span class="Special"> &lt;- </span>copy <span class="Constant">35</span>:literal
+  <span class="Constant">4</span>:number<span class="Special"> &lt;- </span>get-address <span class="Constant">1</span>:address:point/deref<span class="Delimiter">,</span> <span class="Constant">0</span>:offset
 ]
 <span class="traceContains">+run: instruction main/3</span>
 <span class="traceContains">+run: address to copy is 2</span>
-<span class="traceContains">+run: product 0 is 2</span>
+<span class="traceContains">+run: product 0 is 4</span>
 
 <span class="Delimiter">:(after &quot;reagent base = &quot; following &quot;case GET_ADDRESS:&quot;)</span>
 base = canonize<span class="Delimiter">(</span>base<span class="Delimiter">);</span>
@@ -150,15 +150,15 @@ base = canonize<span class="Delimiter">(</span>base<span class="Delimiter">);</s
 <span class="Delimiter">:(code)</span>
 bool has_property<span class="Delimiter">(</span>reagent x<span class="Delimiter">,</span> string name<span class="Delimiter">)</span> <span class="Delimiter">{</span>
   for <span class="Delimiter">(</span>index_t i = <span class="Constant">0</span><span class="Delimiter">;</span> i &lt; x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>size<span class="Delimiter">();</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span>
-    if <span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties[i]<span class="Delimiter">.</span>first == name<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
+    if <span class="Delimiter">(</span>x<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>first == name<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
   <span class="Delimiter">}</span>
   <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span>
 <span class="Delimiter">}</span>
 
 vector&lt;string&gt; property<span class="Delimiter">(</span>const reagent&amp; r<span class="Delimiter">,</span> const string&amp; name<span class="Delimiter">)</span> <span class="Delimiter">{</span>
   for <span class="Delimiter">(</span>index_t p = <span class="Constant">0</span><span class="Delimiter">;</span> p != r<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>size<span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span>
-    if <span class="Delimiter">(</span>r<span class="Delimiter">.</span>properties[p]<span class="Delimiter">.</span>first == name<span class="Delimiter">)</span>
-      <span class="Identifier">return</span> r<span class="Delimiter">.</span>properties[p]<span class="Delimiter">.</span>second<span class="Delimiter">;</span>
+    if <span class="Delimiter">(</span>r<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>p<span class="Delimiter">).</span>first == name<span class="Delimiter">)</span>
+      <span class="Identifier">return</span> r<span class="Delimiter">.</span>properties<span class="Delimiter">.</span>at<span class="Delimiter">(</span>p<span class="Delimiter">).</span>second<span class="Delimiter">;</span>
   <span class="Delimiter">}</span>
   <span class="Identifier">return</span> vector&lt;string&gt;<span class="Delimiter">();</span>
 <span class="Delimiter">}</span>