diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-09-23 19:30:00 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-09-23 19:30:00 -0700 |
commit | 615f4a970a2fa5c91766ee585a7d531b083f4bff (patch) | |
tree | 5fce7848b60fe7e0dae089c94ca228ad74067ce1 /html/034address.cc.html | |
parent | 72cf994869e19f6bdc4678e1122f0082d07d4a11 (diff) | |
download | mu-615f4a970a2fa5c91766ee585a7d531b083f4bff.tar.gz |
4003
Diffstat (limited to 'html/034address.cc.html')
-rw-r--r-- | html/034address.cc.html | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/html/034address.cc.html b/html/034address.cc.html index ed08df0f..ae716fa4 100644 --- a/html/034address.cc.html +++ b/html/034address.cc.html @@ -187,18 +187,18 @@ if ('onhashchange' in window) { <span id="L123" class="LineNr">123 </span><span class="Comment"># call 'new' two times with identical types without modifying the results; you</span> <span id="L124" class="LineNr">124 </span><span class="Comment"># should get back different results</span> <span id="L125" class="LineNr">125 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L126" class="LineNr">126 </span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> -<span id="L127" class="LineNr">127 </span> <span class="Constant">2</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> -<span id="L128" class="LineNr">128 </span> <span class="Constant">3</span>:<span class="Normal">bool</span>/<span class="Special">raw <- </span>equal <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw</span><span class="Delimiter">,</span> <span class="Constant">2</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw</span> +<span id="L126" class="LineNr">126 </span> <span class="Constant">1</span>:address:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> +<span id="L127" class="LineNr">127 </span> <span class="Constant">2</span>:address:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> +<span id="L128" class="LineNr">128 </span> <span class="Constant">3</span>:<span class="Normal">bool</span>/<span class="Special">raw <- </span>equal <span class="Constant">1</span>:address:num/<span class="Special">raw</span><span class="Delimiter">,</span> <span class="Constant">2</span>:address:num/<span class="Special">raw</span> <span id="L129" class="LineNr">129 </span>] <span id="L130" class="LineNr">130 </span><span class="traceContains">+mem: storing 0 in location 3</span> <span id="L131" class="LineNr">131 </span> <span id="L132" class="LineNr">132 </span><span class="Delimiter">:(scenario new_array)</span> <span id="L133" class="LineNr">133 </span><span class="Comment"># call 'new' with a second ingredient to allocate an array of some type rather than a single copy</span> <span id="L134" class="LineNr">134 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L135" class="LineNr">135 </span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:array:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span><span class="Delimiter">,</span> <span class="Constant">5</span> -<span id="L136" class="LineNr">136 </span> <span class="Constant">2</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> -<span id="L137" class="LineNr">137 </span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>subtract <span class="Constant">2</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw</span><span class="Delimiter">,</span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:array:num/<span class="Special">raw</span> +<span id="L135" class="LineNr">135 </span> <span class="Constant">1</span>:address:array:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span><span class="Delimiter">,</span> <span class="Constant">5</span> +<span id="L136" class="LineNr">136 </span> <span class="Constant">2</span>:address:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> +<span id="L137" class="LineNr">137 </span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>subtract <span class="Constant">2</span>:address:num/<span class="Special">raw</span><span class="Delimiter">,</span> <span class="Constant">1</span>:address:array:num/<span class="Special">raw</span> <span id="L138" class="LineNr">138 </span>] <span id="L139" class="LineNr">139 </span><span class="traceContains">+run: {1: ("address" "array" "number"), "raw": ()} <- new {number: "type"}, {5: "literal"}</span> <span id="L140" class="LineNr">140 </span><span class="traceContains">+mem: array length is 5</span> @@ -207,7 +207,7 @@ if ('onhashchange' in window) { <span id="L143" class="LineNr">143 </span> <span id="L144" class="LineNr">144 </span><span class="Delimiter">:(scenario dilated_reagent_with_new)</span> <span id="L145" class="LineNr">145 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L146" class="LineNr">146 </span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:<a href='043space.cc.html#L76'>address</a>:num<span class="Special"> <- </span><span class="Normal">new</span> <span class="Delimiter">{(</span><a href='043space.cc.html#L76'>address</a> number<span class="Delimiter">)</span>: type<span class="Delimiter">}</span> +<span id="L146" class="LineNr">146 </span> <span class="Constant">1</span>:address:address:num<span class="Special"> <- </span><span class="Normal">new</span> <span class="Delimiter">{(</span>address number<span class="Delimiter">)</span>: type<span class="Delimiter">}</span> <span id="L147" class="LineNr">147 </span>] <span id="L148" class="LineNr">148 </span><span class="traceContains">+new: size of '(address number)' is 1</span> <span id="L149" class="LineNr">149 </span> @@ -298,19 +298,19 @@ if ('onhashchange' in window) { <span id="L234" class="LineNr">234 </span><span class="Delimiter">:(scenario new_discerns_singleton_list_from_atom_container)</span> <span id="L235" class="LineNr">235 </span><span class="Special">% Hide_errors = true;</span> <span id="L236" class="LineNr">236 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L237" class="LineNr">237 </span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Delimiter">{(</span>num<span class="Delimiter">)</span>: type<span class="Delimiter">}</span> <span class="Comment"># should be '{num: type}'</span> +<span id="L237" class="LineNr">237 </span> <span class="Constant">1</span>:address:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Delimiter">{(</span>num<span class="Delimiter">)</span>: type<span class="Delimiter">}</span> <span class="Comment"># should be '{num: type}'</span> <span id="L238" class="LineNr">238 </span>] <span id="L239" class="LineNr">239 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: product of 'new' has incorrect type: '1:address:num/raw <- new {(num): type}'</span> <span id="L240" class="LineNr">240 </span> <span id="L241" class="LineNr">241 </span><span class="Delimiter">:(scenario new_with_type_abbreviation)</span> <span id="L242" class="LineNr">242 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L243" class="LineNr">243 </span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">num:type</span> +<span id="L243" class="LineNr">243 </span> <span class="Constant">1</span>:address:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">num:type</span> <span id="L244" class="LineNr">244 </span>] <span id="L245" class="LineNr">245 </span>$error: <span class="Constant">0</span> <span id="L246" class="LineNr">246 </span> <span id="L247" class="LineNr">247 </span><span class="Delimiter">:(scenario new_with_type_abbreviation_inside_compound)</span> <span id="L248" class="LineNr">248 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L249" class="LineNr">249 </span> <span class="Delimiter">{</span><span class="Constant">1</span>: <span class="Delimiter">(</span><a href='043space.cc.html#L76'>address</a> <a href='043space.cc.html#L76'>address</a> number<span class="Delimiter">),</span> <span class="Special">raw</span>: <span class="Delimiter">()}</span><span class="Special"> <- </span><span class="Normal">new</span> <span class="Delimiter">{(</span>& num<span class="Delimiter">)</span>: type<span class="Delimiter">}</span> +<span id="L249" class="LineNr">249 </span> <span class="Delimiter">{</span><span class="Constant">1</span>: <span class="Delimiter">(</span>address address number<span class="Delimiter">),</span> <span class="Special">raw</span>: <span class="Delimiter">()}</span><span class="Special"> <- </span><span class="Normal">new</span> <span class="Delimiter">{(</span>& num<span class="Delimiter">)</span>: type<span class="Delimiter">}</span> <span id="L250" class="LineNr">250 </span>] <span id="L251" class="LineNr">251 </span>$error: <span class="Constant">0</span> <span id="L252" class="LineNr">252 </span> @@ -405,9 +405,9 @@ if ('onhashchange' in window) { <span id="L341" class="LineNr">341 </span> <span class="Normal">const</span> <span class="Normal">int</span> result = Current_routine<span class="Delimiter">-></span>alloc<span class="Delimiter">;</span> <span id="L342" class="LineNr">342 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"new alloc: "</span> << result << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> <span id="L343" class="LineNr">343 </span> <span class="Comment">// initialize allocated space</span> -<span id="L344" class="LineNr">344 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> <a href='043space.cc.html#L76'>address</a> = result<span class="Delimiter">;</span> <a href='043space.cc.html#L76'>address</a> < result+size<span class="Delimiter">;</span> ++address<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L345" class="LineNr">345 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0 in location "</span> << <a href='043space.cc.html#L76'>address</a> << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> -<span id="L346" class="LineNr">346 </span> <span class="Conceal">¦</span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <a href='043space.cc.html#L76'>address</a><span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> +<span id="L344" class="LineNr">344 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> address = result<span class="Delimiter">;</span> address < result+size<span class="Delimiter">;</span> ++address<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L345" class="LineNr">345 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9999</span><span class="Delimiter">,</span> <span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing 0 in location "</span> << address << <a href='003trace.cc.html#L197'>end</a><span class="Delimiter">();</span> +<span id="L346" class="LineNr">346 </span> <span class="Conceal">¦</span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> <span id="L347" class="LineNr">347 </span> <span class="Delimiter">}</span> <span id="L348" class="LineNr">348 </span> Current_routine<span class="Delimiter">-></span>alloc += size<span class="Delimiter">;</span> <span id="L349" class="LineNr">349 </span> <span class="Comment">// no support yet for reclaiming memory between routines</span> @@ -448,33 +448,33 @@ if ('onhashchange' in window) { <span id="L384" class="LineNr">384 </span><span class="Special">% Memory_allocated_until = 10;</span> <span id="L385" class="LineNr">385 </span><span class="Special">% put(Memory, Memory_allocated_until, 1);</span> <span id="L386" class="LineNr">386 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L387" class="LineNr">387 </span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:num<span class="Special"> <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> +<span id="L387" class="LineNr">387 </span> <span class="Constant">1</span>:address:num<span class="Special"> <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> <span id="L388" class="LineNr">388 </span>] <span id="L389" class="LineNr">389 </span><span class="traceContains">+mem: storing 0 in location 10</span> <span id="L390" class="LineNr">390 </span> <span id="L391" class="LineNr">391 </span><span class="Delimiter">:(scenario new_size)</span> <span id="L392" class="LineNr">392 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L393" class="LineNr">393 </span> <span class="Constant">11</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> -<span id="L394" class="LineNr">394 </span> <span class="Constant">12</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> -<span id="L395" class="LineNr">395 </span> <span class="Constant">13</span>:num/<span class="Special">raw <- </span>subtract <span class="Constant">12</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw</span><span class="Delimiter">,</span> <span class="Constant">11</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw</span> +<span id="L393" class="LineNr">393 </span> <span class="Constant">11</span>:address:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> +<span id="L394" class="LineNr">394 </span> <span class="Constant">12</span>:address:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> +<span id="L395" class="LineNr">395 </span> <span class="Constant">13</span>:num/<span class="Special">raw <- </span>subtract <span class="Constant">12</span>:address:num/<span class="Special">raw</span><span class="Delimiter">,</span> <span class="Constant">11</span>:address:num/<span class="Special">raw</span> <span id="L396" class="LineNr">396 </span>] <span id="L397" class="LineNr">397 </span><span class="Comment"># size of number + refcount</span> <span id="L398" class="LineNr">398 </span><span class="traceContains">+mem: storing 2 in location 13</span> <span id="L399" class="LineNr">399 </span> <span id="L400" class="LineNr">400 </span><span class="Delimiter">:(scenario new_array_size)</span> <span id="L401" class="LineNr">401 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L402" class="LineNr">402 </span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:array:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span><span class="Delimiter">,</span> <span class="Constant">5</span> -<span id="L403" class="LineNr">403 </span> <span class="Constant">2</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> -<span id="L404" class="LineNr">404 </span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>subtract <span class="Constant">2</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw</span><span class="Delimiter">,</span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:array:num/<span class="Special">raw</span> +<span id="L402" class="LineNr">402 </span> <span class="Constant">1</span>:address:array:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span><span class="Delimiter">,</span> <span class="Constant">5</span> +<span id="L403" class="LineNr">403 </span> <span class="Constant">2</span>:address:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> +<span id="L404" class="LineNr">404 </span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>subtract <span class="Constant">2</span>:address:num/<span class="Special">raw</span><span class="Delimiter">,</span> <span class="Constant">1</span>:address:array:num/<span class="Special">raw</span> <span id="L405" class="LineNr">405 </span>] <span id="L406" class="LineNr">406 </span><span class="Comment"># 5 locations for array contents + array length + refcount</span> <span id="L407" class="LineNr">407 </span><span class="traceContains">+mem: storing 7 in location 3</span> <span id="L408" class="LineNr">408 </span> <span id="L409" class="LineNr">409 </span><span class="Delimiter">:(scenario new_empty_array)</span> <span id="L410" class="LineNr">410 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L411" class="LineNr">411 </span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:array:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span><span class="Delimiter">,</span> <span class="Constant">0</span> -<span id="L412" class="LineNr">412 </span> <span class="Constant">2</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> -<span id="L413" class="LineNr">413 </span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>subtract <span class="Constant">2</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw</span><span class="Delimiter">,</span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:array:num/<span class="Special">raw</span> +<span id="L411" class="LineNr">411 </span> <span class="Constant">1</span>:address:array:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span><span class="Delimiter">,</span> <span class="Constant">0</span> +<span id="L412" class="LineNr">412 </span> <span class="Constant">2</span>:address:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> +<span id="L413" class="LineNr">413 </span> <span class="Constant">3</span>:num/<span class="Special">raw <- </span>subtract <span class="Constant">2</span>:address:num/<span class="Special">raw</span><span class="Delimiter">,</span> <span class="Constant">1</span>:address:array:num/<span class="Special">raw</span> <span id="L414" class="LineNr">414 </span>] <span id="L415" class="LineNr">415 </span><span class="traceContains">+run: {1: ("address" "array" "number"), "raw": ()} <- new {number: "type"}, {0: "literal"}</span> <span id="L416" class="LineNr">416 </span><span class="traceContains">+mem: array length is 0</span> @@ -485,8 +485,8 @@ if ('onhashchange' in window) { <span id="L421" class="LineNr">421 </span><span class="Delimiter">:(scenario new_overflow)</span> <span id="L422" class="LineNr">422 </span><span class="Special">% Initial_memory_per_routine = 3; // barely enough room for point allocation below</span> <span id="L423" class="LineNr">423 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L424" class="LineNr">424 </span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> -<span id="L425" class="LineNr">425 </span> <span class="Constant">2</span>:<a href='043space.cc.html#L76'>address</a>:point/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">point:type</span> <span class="Comment"># not enough room in initial page</span> +<span id="L424" class="LineNr">424 </span> <span class="Constant">1</span>:address:num/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">number:type</span> +<span id="L425" class="LineNr">425 </span> <span class="Constant">2</span>:address:point/<span class="Special">raw <- </span><span class="Normal">new</span> <span class="Constant">point:type</span> <span class="Comment"># not enough room in initial page</span> <span id="L426" class="LineNr">426 </span>] <span id="L427" class="LineNr">427 </span><span class="traceContains">+new: routine allocated memory from 1000 to 1003</span> <span id="L428" class="LineNr">428 </span><span class="traceContains">+new: routine allocated memory from 1003 to 1006</span> @@ -494,7 +494,7 @@ if ('onhashchange' in window) { <span id="L430" class="LineNr">430 </span><span class="Delimiter">:(scenario new_without_ingredient)</span> <span id="L431" class="LineNr">431 </span><span class="Special">% Hide_errors = true;</span> <span id="L432" class="LineNr">432 </span><span class="muRecipe">def</span> <a href='000organization.cc.html#L113'>main</a> [ -<span id="L433" class="LineNr">433 </span> <span class="Constant">1</span>:<a href='043space.cc.html#L76'>address</a>:number<span class="Special"> <- </span><span class="Normal">new</span> <span class="Comment"># missing ingredient</span> +<span id="L433" class="LineNr">433 </span> <span class="Constant">1</span>:address:number<span class="Special"> <- </span><span class="Normal">new</span> <span class="Comment"># missing ingredient</span> <span id="L434" class="LineNr">434 </span>] <span id="L435" class="LineNr">435 </span><span class="traceContains">+error: <a href='000organization.cc.html#L113'>main</a>: 'new' requires one or two ingredients, but got '1:address:number <- new'</span> </pre> |