diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-12-01 14:13:33 -0800 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-12-01 14:13:33 -0800 |
commit | e4ac3c9e6e5464a0fc0f8fd3763a572e0e180c04 (patch) | |
tree | 7f6ca26afcdf8e3bf54459c6592ebf26fb968133 /html/032array.cc.html | |
parent | 54e5128a14dcea5b93a8a9402558f0736fb7dba3 (diff) | |
download | mu-e4ac3c9e6e5464a0fc0f8fd3763a572e0e180c04.tar.gz |
4814
Diffstat (limited to 'html/032array.cc.html')
-rw-r--r-- | html/032array.cc.html | 113 |
1 files changed, 58 insertions, 55 deletions
diff --git a/html/032array.cc.html b/html/032array.cc.html index 57c3220b..8e3b58b5 100644 --- a/html/032array.cc.html +++ b/html/032array.cc.html @@ -11,21 +11,23 @@ <style type="text/css"> <!-- pre { white-space: pre-wrap; font-family: monospace; color: #aaaaaa; background-color: #080808; } -body { font-size: 12pt; font-family: monospace; color: #aaaaaa; background-color: #080808; } -a { color:#eeeeee; text-decoration: none; } -a:hover { text-decoration: underline; } -* { font-size: 12pt; font-size: 1em; } +body { font-size:12pt; font-family: monospace; color: #aaaaaa; background-color: #080808; } +.subxS2Comment a { color:inherit; } +.subxS1Comment a { color:inherit; } +.subxComment a { color:inherit; } +.subxH2Comment a { color:inherit; } +.subxH1Comment a { color:inherit; } +* { font-size:12pt; font-size: 1em; } .cSpecial { color: #008000; } -.LineNr { color: #444444; } +.LineNr { color:#444444; } .muData { color: #ffff00; } -.Constant { color: #00a0a0; } +.Constant { color:#00a0a0; } .muRecipe { color: #ff8700; } -.Delimiter { color: #800080; } -.Special { color: #c00000; } -.Identifier { color: #c0a020; } +.Delimiter { color:#800080; } +.Special { color:#c00000; } +.Identifier { color:#c0a020; } .Normal { color: #aaaaaa; background-color: #080808; padding-bottom: 1px; } -.Comment { color: #9090ff; } -.Comment a { color:#0000ee; text-decoration:underline; } +.Comment { color: #8080ff; } .SalientComment { color: #00ffff; } .traceContains { color: #008000; } --> @@ -61,6 +63,7 @@ if ('onhashchange' in window) { </script> </head> <body onload='JumpToLine();'> +<a href='https://github.com/akkartik/mu/blob/master/032array.cc'>https://github.com/akkartik/mu/blob/master/032array.cc</a> <pre id='vimCodeElement'> <span id="L1" class="LineNr"> 1 </span><span class="Comment">//: Arrays contain a variable number of elements of the same type. Their value</span> <span id="L2" class="LineNr"> 2 </span><span class="Comment">//: starts with the length of the array.</span> @@ -80,33 +83,33 @@ if ('onhashchange' in window) { <span id="L16" class="LineNr"> 16 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L17" class="LineNr"> 17 </span>CREATE_ARRAY<span class="Delimiter">,</span> <span id="L18" class="LineNr"> 18 </span><span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -<span id="L19" class="LineNr"> 19 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"create-array"</span><span class="Delimiter">,</span> CREATE_ARRAY<span class="Delimiter">);</span> +<span id="L19" class="LineNr"> 19 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Recipe_ordinal</span><span class="Delimiter">,</span> <span class="Constant">"create-array"</span><span class="Delimiter">,</span> CREATE_ARRAY<span class="Delimiter">);</span> <span id="L20" class="LineNr"> 20 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L21" class="LineNr"> 21 </span><span class="Normal">case</span> CREATE_ARRAY: <span class="Delimiter">{</span> <span id="L22" class="LineNr"> 22 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Delimiter">{</span> -<span id="L23" class="LineNr"> 23 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'create-array' needs one product and no ingredients but got '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> +<span id="L23" class="LineNr"> 23 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'create-array' needs one product and no ingredients but got '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span> << end<span class="Delimiter">();</span> <span id="L24" class="LineNr"> 24 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L25" class="LineNr"> 25 </span> <span class="Delimiter">}</span> <span id="L26" class="LineNr"> 26 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> product = inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L27" class="LineNr"> 27 </span> <span class="Comment">// Update CREATE_ARRAY product in Check</span> <span id="L28" class="LineNr"> 28 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_array<span class="Delimiter">(</span>product<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L29" class="LineNr"> 29 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'create-array' cannot create non-array '"</span> << product<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L29" class="LineNr"> 29 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'create-array' cannot create non-array '"</span> << product<span class="Delimiter">.</span>original_string << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L30" class="LineNr"> 30 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L31" class="LineNr"> 31 </span> <span class="Delimiter">}</span> <span id="L32" class="LineNr"> 32 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!product<span class="Delimiter">.</span>type<span class="Delimiter">-></span>right<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L33" class="LineNr"> 33 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"create array of what? '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L33" class="LineNr"> 33 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"create array of what? '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L34" class="LineNr"> 34 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L35" class="LineNr"> 35 </span> <span class="Delimiter">}</span> <span id="L36" class="LineNr"> 36 </span> <span class="Comment">// 'create-array' will need to check properties rather than types</span> <span id="L37" class="LineNr"> 37 </span> type_tree* array_length_from_type = product<span class="Delimiter">.</span>type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right<span class="Delimiter">;</span> <span id="L38" class="LineNr"> 38 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!array_length_from_type<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L39" class="LineNr"> 39 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"create array of what size? '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L39" class="LineNr"> 39 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"create array of what size? '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L40" class="LineNr"> 40 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L41" class="LineNr"> 41 </span> <span class="Delimiter">}</span> <span id="L42" class="LineNr"> 42 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!product<span class="Delimiter">.</span>type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right<span class="Delimiter">-></span>atom<span class="Delimiter">)</span> <span id="L43" class="LineNr"> 43 </span> array_length_from_type = array_length_from_type<span class="Delimiter">-></span>left<span class="Delimiter">;</span> <span id="L44" class="LineNr"> 44 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_integer<span class="Delimiter">(</span>array_length_from_type<span class="Delimiter">-></span>name<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L45" class="LineNr"> 45 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'create-array' product should specify size of array after its element type, but got '"</span> << product<span class="Delimiter">.</span>type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right<span class="Delimiter">-></span>name << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L45" class="LineNr"> 45 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'create-array' product should specify size of array after its element type, but got '"</span> << product<span class="Delimiter">.</span>type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right<span class="Delimiter">-></span>name << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L46" class="LineNr"> 46 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L47" class="LineNr"> 47 </span> <span class="Delimiter">}</span> <span id="L48" class="LineNr"> 48 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -122,12 +125,12 @@ if ('onhashchange' in window) { <span id="L58" class="LineNr"> 58 </span> <span class="Normal">int</span> <a href='032array.cc.html#L319'>array_length</a> = to_integer<span class="Delimiter">(</span>array_length_from_type<span class="Delimiter">-></span>name<span class="Delimiter">);</span> <span id="L59" class="LineNr"> 59 </span> <span class="Comment">// initialize array length, so that size_of will work</span> <span id="L60" class="LineNr"> 60 </span> <a href='003trace.cc.html#L189'>trace</a><span class="Delimiter">(</span><span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing "</span> << <a href='032array.cc.html#L319'>array_length</a> << <span class="Constant">" in location "</span> << base_address << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> -<span id="L61" class="LineNr"> 61 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> base_address<span class="Delimiter">,</span> <a href='032array.cc.html#L319'>array_length</a><span class="Delimiter">);</span> <span class="Comment">// in array elements</span> +<span id="L61" class="LineNr"> 61 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> base_address<span class="Delimiter">,</span> <a href='032array.cc.html#L319'>array_length</a><span class="Delimiter">);</span> <span class="Comment">// in array elements</span> <span id="L62" class="LineNr"> 62 </span> <span class="Normal">int</span> size = size_of<span class="Delimiter">(</span>product<span class="Delimiter">);</span> <span class="Comment">// in locations</span> <span id="L63" class="LineNr"> 63 </span> <a href='003trace.cc.html#L189'>trace</a><span class="Delimiter">(</span><span class="Constant">9998</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"creating array from "</span> << size << <span class="Constant">" locations"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L64" class="LineNr"> 64 </span> <span class="Comment">// initialize array</span> <span id="L65" class="LineNr"> 65 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">1</span><span class="Delimiter">;</span> i <= size_of<span class="Delimiter">(</span>product<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> -<span id="L66" class="LineNr"> 66 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> base_address+i<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> +<span id="L66" class="LineNr"> 66 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> base_address+i<span class="Delimiter">,</span> <span class="Constant">0</span><span class="Delimiter">);</span> <span id="L67" class="LineNr"> 67 </span> <span class="Comment">// no need to update product</span> <span id="L68" class="LineNr"> 68 </span> write_products =<span class="Constant"> false</span><span class="Delimiter">;</span> <span id="L69" class="LineNr"> 69 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -167,16 +170,16 @@ if ('onhashchange' in window) { <span id="L103" class="LineNr">103 </span> <span class="Identifier">return</span> types_strictly_match<span class="Delimiter">(</span><a href='032array.cc.html#L303'>array_element</a><span class="Delimiter">(</span>from<span class="Delimiter">.</span>type<span class="Delimiter">),</span> <a href='032array.cc.html#L303'>array_element</a><span class="Delimiter">(</span>to<span class="Delimiter">.</span>type<span class="Delimiter">));</span> <span id="L104" class="LineNr">104 </span> <span id="L105" class="LineNr">105 </span><span class="Delimiter">:(before "End size_of(reagent r) Special-cases")</span> -<span id="L106" class="LineNr">106 </span><span class="Normal">if</span> <span class="Delimiter">(</span>!r<span class="Delimiter">.</span>type<span class="Delimiter">-></span>atom && r<span class="Delimiter">.</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>atom && r<span class="Delimiter">.</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>value == Array_type_ordinal<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L106" class="LineNr">106 </span><span class="Normal">if</span> <span class="Delimiter">(</span>!r<span class="Delimiter">.</span>type<span class="Delimiter">-></span>atom && r<span class="Delimiter">.</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>atom && r<span class="Delimiter">.</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>value == <span class="Special">Array_type_ordinal</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L107" class="LineNr">107 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!r<span class="Delimiter">.</span>type<span class="Delimiter">-></span>right<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L108" class="LineNr">108 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"'"</span> << r<span class="Delimiter">.</span>original_string << <span class="Constant">"' is an array of what?</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L108" class="LineNr">108 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"'"</span> << r<span class="Delimiter">.</span>original_string << <span class="Constant">"' is an array of what?\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L109" class="LineNr">109 </span> <span class="Identifier">return</span> <span class="Constant">1</span><span class="Delimiter">;</span> <span id="L110" class="LineNr">110 </span> <span class="Delimiter">}</span> <span id="L111" class="LineNr">111 </span> <span class="Identifier">return</span> <span class="Comment">/*</span><span class="Comment">space for length</span><span class="Comment">*/</span><span class="Constant">1</span> + <a href='032array.cc.html#L319'>array_length</a><span class="Delimiter">(</span>r<span class="Delimiter">)</span>*size_of<span class="Delimiter">(</span><a href='032array.cc.html#L303'>array_element</a><span class="Delimiter">(</span>r<span class="Delimiter">.</span>type<span class="Delimiter">));</span> <span id="L112" class="LineNr">112 </span><span class="Delimiter">}</span> <span id="L113" class="LineNr">113 </span> <span id="L114" class="LineNr">114 </span><span class="Delimiter">:(before "End size_of(type) Non-atom Special-cases")</span> -<span id="L115" class="LineNr">115 </span><span class="Normal">if</span> <span class="Delimiter">(</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>value == Array_type_ordinal<span class="Delimiter">)</span> <span class="Identifier">return</span> <a href='032array.cc.html#L117'>static_array_length</a><span class="Delimiter">(</span>type<span class="Delimiter">);</span> +<span id="L115" class="LineNr">115 </span><span class="Normal">if</span> <span class="Delimiter">(</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>value == <span class="Special">Array_type_ordinal</span><span class="Delimiter">)</span> <span class="Identifier">return</span> <a href='032array.cc.html#L117'>static_array_length</a><span class="Delimiter">(</span>type<span class="Delimiter">);</span> <span id="L116" class="LineNr">116 </span><span class="Delimiter">:(code)</span> <span id="L117" class="LineNr">117 </span><span class="Normal">int</span> <a href='032array.cc.html#L117'>static_array_length</a><span class="Delimiter">(</span><span class="Normal">const</span> type_tree* type<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L118" class="LineNr">118 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!type<span class="Delimiter">-></span>atom && type<span class="Delimiter">-></span>right && !type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>atom && type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right && !type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right<span class="Delimiter">-></span>atom && !type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right <span class="Comment">// exactly 3 types</span> @@ -191,7 +194,7 @@ if ('onhashchange' in window) { <span id="L127" class="LineNr">127 </span><span class="Comment">//: disable the size mismatch check for arrays since the destination array</span> <span id="L128" class="LineNr">128 </span><span class="Comment">//: need not be initialized</span> <span id="L129" class="LineNr">129 </span><span class="Delimiter">:(before "End size_mismatch(x) Special-cases")</span> -<span id="L130" class="LineNr">130 </span><span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>type && !x<span class="Delimiter">.</span>type<span class="Delimiter">-></span>atom && x<span class="Delimiter">.</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>value == Array_type_ordinal<span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Constant"> false</span><span class="Delimiter">;</span> +<span id="L130" class="LineNr">130 </span><span class="Normal">if</span> <span class="Delimiter">(</span>x<span class="Delimiter">.</span>type && !x<span class="Delimiter">.</span>type<span class="Delimiter">-></span>atom && x<span class="Delimiter">.</span>type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>value == <span class="Special">Array_type_ordinal</span><span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Constant"> false</span><span class="Delimiter">;</span> <span id="L131" class="LineNr">131 </span> <span id="L132" class="LineNr">132 </span><span class="SalientComment">//:: arrays inside containers</span> <span id="L133" class="LineNr">133 </span><span class="Comment">//: arrays are disallowed inside containers unless their length is fixed in</span> @@ -219,16 +222,16 @@ if ('onhashchange' in window) { <span id="L155" class="LineNr">155 </span><span class="Delimiter">{</span> <span id="L156" class="LineNr">156 </span> <span class="Normal">const</span> type_tree* type = info<span class="Delimiter">.</span>elements<span class="Delimiter">.</span>back<span class="Delimiter">().</span>type<span class="Delimiter">;</span> <span id="L157" class="LineNr">157 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>type && type<span class="Delimiter">-></span>atom && type<span class="Delimiter">-></span>name == <span class="Constant">"array"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L158" class="LineNr">158 </span> <a href='003trace.cc.html#L196'>raise</a> << <span class="Constant">"container '"</span> << name << <span class="Constant">"' doesn't specify type of array elements for '"</span> << info<span class="Delimiter">.</span>elements<span class="Delimiter">.</span>back<span class="Delimiter">().</span>name << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L158" class="LineNr">158 </span> <a href='003trace.cc.html#L196'>raise</a> << <span class="Constant">"container '"</span> << name << <span class="Constant">"' doesn't specify type of array elements for '"</span> << info<span class="Delimiter">.</span>elements<span class="Delimiter">.</span>back<span class="Delimiter">().</span>name << <span class="Constant">"'\n"</span> << end<span class="Delimiter">();</span> <span id="L159" class="LineNr">159 </span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L160" class="LineNr">160 </span> <span class="Delimiter">}</span> <span id="L161" class="LineNr">161 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>type && !type<span class="Delimiter">-></span>atom && type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>atom && type<span class="Delimiter">-></span>left<span class="Delimiter">-></span>name == <span class="Constant">"array"</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L162" class="LineNr">162 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!type<span class="Delimiter">-></span>right<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L163" class="LineNr">163 </span> <a href='003trace.cc.html#L196'>raise</a> << <span class="Constant">"container '"</span> << name << <span class="Constant">"' doesn't specify type of array elements for '"</span> << info<span class="Delimiter">.</span>elements<span class="Delimiter">.</span>back<span class="Delimiter">().</span>name << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L163" class="LineNr">163 </span> <a href='003trace.cc.html#L196'>raise</a> << <span class="Constant">"container '"</span> << name << <span class="Constant">"' doesn't specify type of array elements for '"</span> << info<span class="Delimiter">.</span>elements<span class="Delimiter">.</span>back<span class="Delimiter">().</span>name << <span class="Constant">"'\n"</span> << end<span class="Delimiter">();</span> <span id="L164" class="LineNr">164 </span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L165" class="LineNr">165 </span> <span class="Delimiter">}</span> <span id="L166" class="LineNr">166 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right || !is_integer<span class="Delimiter">(</span>type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right<span class="Delimiter">-></span>left<span class="Delimiter">-></span>name<span class="Delimiter">))</span> <span class="Delimiter">{</span> <span class="Comment">// array has no length</span> -<span id="L167" class="LineNr">167 </span> <a href='003trace.cc.html#L196'>raise</a> << <span class="Constant">"container '"</span> << name << <span class="Constant">"' cannot determine size of element '"</span> << info<span class="Delimiter">.</span>elements<span class="Delimiter">.</span>back<span class="Delimiter">().</span>name << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L167" class="LineNr">167 </span> <a href='003trace.cc.html#L196'>raise</a> << <span class="Constant">"container '"</span> << name << <span class="Constant">"' cannot determine size of element '"</span> << info<span class="Delimiter">.</span>elements<span class="Delimiter">.</span>back<span class="Delimiter">().</span>name << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L168" class="LineNr">168 </span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L169" class="LineNr">169 </span> <span class="Delimiter">}</span> <span id="L170" class="LineNr">170 </span> <span class="Delimiter">}</span> @@ -237,7 +240,7 @@ if ('onhashchange' in window) { <span id="L173" class="LineNr">173 </span><span class="Comment">//: disable the size mismatch check for 'merge' instructions since containers</span> <span id="L174" class="LineNr">174 </span><span class="Comment">//: can contain arrays, and since we already do plenty of checking for them</span> <span id="L175" class="LineNr">175 </span><span class="Delimiter">:(before "End size_mismatch(x) Special-cases")</span> -<span id="L176" class="LineNr">176 </span><span class="Normal">if</span> <span class="Delimiter">(</span><a href='026call.cc.html#L83'>current_call</a><span class="Delimiter">().</span>running_step_index < <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> <a href='026call.cc.html#L83'>current_call</a><span class="Delimiter">().</span>running_recipe<span class="Delimiter">).</span>steps<span class="Delimiter">)</span> +<span id="L176" class="LineNr">176 </span><span class="Normal">if</span> <span class="Delimiter">(</span><a href='026call.cc.html#L83'>current_call</a><span class="Delimiter">().</span>running_step_index < <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> <a href='026call.cc.html#L83'>current_call</a><span class="Delimiter">().</span>running_recipe<span class="Delimiter">).</span>steps<span class="Delimiter">)</span> <span id="L177" class="LineNr">177 </span> && <a href='026call.cc.html#L89'>current_instruction</a><span class="Delimiter">().</span>operation == MERGE<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L178" class="LineNr">178 </span> <span class="Identifier">return</span><span class="Constant"> false</span><span class="Delimiter">;</span> <span id="L179" class="LineNr">179 </span><span class="Delimiter">}</span> @@ -304,23 +307,23 @@ if ('onhashchange' in window) { <span id="L240" class="LineNr">240 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L241" class="LineNr">241 </span>INDEX<span class="Delimiter">,</span> <span id="L242" class="LineNr">242 </span><span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -<span id="L243" class="LineNr">243 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"index"</span><span class="Delimiter">,</span> INDEX<span class="Delimiter">);</span> +<span id="L243" class="LineNr">243 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Recipe_ordinal</span><span class="Delimiter">,</span> <span class="Constant">"index"</span><span class="Delimiter">,</span> INDEX<span class="Delimiter">);</span> <span id="L244" class="LineNr">244 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L245" class="LineNr">245 </span><span class="Normal">case</span> INDEX: <span class="Delimiter">{</span> <span id="L246" class="LineNr">246 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">2</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L247" class="LineNr">247 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'index' expects exactly 2 ingredients in '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L247" class="LineNr">247 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'index' expects exactly 2 ingredients in '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L248" class="LineNr">248 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L249" class="LineNr">249 </span> <span class="Delimiter">}</span> <span id="L250" class="LineNr">250 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> base = inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L251" class="LineNr">251 </span> <span class="Comment">// Update INDEX base in Check</span> <span id="L252" class="LineNr">252 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_array<span class="Delimiter">(</span>base<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L253" class="LineNr">253 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'index' on a non-array '"</span> << base<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L253" class="LineNr">253 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'index' on a non-array '"</span> << base<span class="Delimiter">.</span>original_string << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L254" class="LineNr">254 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L255" class="LineNr">255 </span> <span class="Delimiter">}</span> <span id="L256" class="LineNr">256 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> index = inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L257" class="LineNr">257 </span> <span class="Comment">// Update INDEX index in Check</span> <span id="L258" class="LineNr">258 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_number<span class="Delimiter">(</span>index<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L259" class="LineNr">259 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"second ingredient of 'index' should be a number, but got '"</span> << index<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L259" class="LineNr">259 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"second ingredient of 'index' should be a number, but got '"</span> << index<span class="Delimiter">.</span>original_string << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L260" class="LineNr">260 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L261" class="LineNr">261 </span> <span class="Delimiter">}</span> <span id="L262" class="LineNr">262 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -328,7 +331,7 @@ if ('onhashchange' in window) { <span id="L264" class="LineNr">264 </span> <span class="Comment">// Update INDEX product in Check</span> <span id="L265" class="LineNr">265 </span> reagent<span class="Comment">/*</span><span class="Comment">local</span><span class="Comment">*/</span> element<span class="Delimiter">(</span><a href='032array.cc.html#L299'>copy_array_element</a><span class="Delimiter">(</span>base<span class="Delimiter">.</span>type<span class="Delimiter">));</span> <span id="L266" class="LineNr">266 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!types_coercible<span class="Delimiter">(</span>product<span class="Delimiter">,</span> element<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L267" class="LineNr">267 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'index' on '"</span> << base<span class="Delimiter">.</span>original_string << <span class="Constant">"' can't be saved in '"</span> << product<span class="Delimiter">.</span>original_string << <span class="Constant">"'; type should be '"</span> << names_to_string_without_quotes<span class="Delimiter">(</span>element<span class="Delimiter">.</span>type<span class="Delimiter">)</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> +<span id="L267" class="LineNr">267 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'index' on '"</span> << base<span class="Delimiter">.</span>original_string << <span class="Constant">"' can't be saved in '"</span> << product<span class="Delimiter">.</span>original_string << <span class="Constant">"'; type should be '"</span> << names_to_string_without_quotes<span class="Delimiter">(</span>element<span class="Delimiter">.</span>type<span class="Delimiter">)</span> << <span class="Constant">"'\n"</span> << end<span class="Delimiter">();</span> <span id="L268" class="LineNr">268 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L269" class="LineNr">269 </span> <span class="Delimiter">}</span> <span id="L270" class="LineNr">270 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -340,14 +343,14 @@ if ('onhashchange' in window) { <span id="L276" class="LineNr">276 </span> <span class="Normal">int</span> base_address = base<span class="Delimiter">.</span>value<span class="Delimiter">;</span> <span id="L277" class="LineNr">277 </span> <a href='003trace.cc.html#L189'>trace</a><span class="Delimiter">(</span><span class="Constant">9998</span><span class="Delimiter">,</span> <span class="Constant">"run"</span><span class="Delimiter">)</span> << <span class="Constant">"base <a href='043space.cc.html#L101'>address</a> is "</span> << base_address << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L278" class="LineNr">278 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>base_address == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L279" class="LineNr">279 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"tried to access location 0 in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L279" class="LineNr">279 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"tried to access location 0 in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L280" class="LineNr">280 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L281" class="LineNr">281 </span> <span class="Delimiter">}</span> <span id="L282" class="LineNr">282 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> index = <a href='026call.cc.html#L89'>current_instruction</a><span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L283" class="LineNr">283 </span> <span class="Comment">// Update INDEX index in Run</span> <span id="L284" class="LineNr">284 </span> vector<<span class="Normal">double</span>> index_val<span class="Delimiter">(</span>read_memory<span class="Delimiter">(</span>index<span class="Delimiter">));</span> -<span id="L285" class="LineNr">285 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> < <span class="Constant">0</span> || index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> >= <a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> base_address<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L286" class="LineNr">286 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"invalid index "</span> << no_scientific<span class="Delimiter">(</span>index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> << <span class="Constant">" in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L285" class="LineNr">285 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> < <span class="Constant">0</span> || index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> >= <a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> base_address<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L286" class="LineNr">286 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"invalid index "</span> << no_scientific<span class="Delimiter">(</span>index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> << <span class="Constant">" in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L287" class="LineNr">287 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L288" class="LineNr">288 </span> <span class="Delimiter">}</span> <span id="L289" class="LineNr">289 </span> reagent<span class="Comment">/*</span><span class="Comment">local</span><span class="Comment">*/</span> element<span class="Delimiter">(</span><a href='032array.cc.html#L299'>copy_array_element</a><span class="Delimiter">(</span>base<span class="Delimiter">.</span>type<span class="Delimiter">));</span> @@ -389,15 +392,15 @@ if ('onhashchange' in window) { <span id="L325" class="LineNr">325 </span> <span class="Identifier">return</span> to_integer<span class="Delimiter">(</span>x<span class="Delimiter">.</span>type<span class="Delimiter">-></span>right<span class="Delimiter">-></span>right<span class="Delimiter">-></span>left<span class="Delimiter">-></span>name<span class="Delimiter">);</span> <span id="L326" class="LineNr">326 </span> <span class="Delimiter">}</span> <span id="L327" class="LineNr">327 </span> <span class="Comment">// this should never happen at transform time</span> -<span id="L328" class="LineNr">328 </span> <span class="Identifier">return</span> <a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> x<span class="Delimiter">.</span>value<span class="Delimiter">);</span> +<span id="L328" class="LineNr">328 </span> <span class="Identifier">return</span> <a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> x<span class="Delimiter">.</span>value<span class="Delimiter">);</span> <span id="L329" class="LineNr">329 </span><span class="Delimiter">}</span> <span id="L330" class="LineNr">330 </span> <span id="L331" class="LineNr">331 </span><span class="Delimiter">:(before "End Unit Tests")</span> <span id="L332" class="LineNr">332 </span><span class="Normal">void</span> <a href='032array.cc.html#L332'>test_array_length_compound</a><span class="Delimiter">()</span> <span class="Delimiter">{</span> -<span id="L333" class="LineNr">333 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">3</span><span class="Delimiter">);</span> -<span id="L334" class="LineNr">334 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <span class="Constant">2</span><span class="Delimiter">,</span> <span class="Constant">14</span><span class="Delimiter">);</span> -<span id="L335" class="LineNr">335 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">15</span><span class="Delimiter">);</span> -<span id="L336" class="LineNr">336 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> <span class="Constant">4</span><span class="Delimiter">,</span> <span class="Constant">16</span><span class="Delimiter">);</span> +<span id="L333" class="LineNr">333 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> <span class="Constant">1</span><span class="Delimiter">,</span> <span class="Constant">3</span><span class="Delimiter">);</span> +<span id="L334" class="LineNr">334 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> <span class="Constant">2</span><span class="Delimiter">,</span> <span class="Constant">14</span><span class="Delimiter">);</span> +<span id="L335" class="LineNr">335 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> <span class="Constant">3</span><span class="Delimiter">,</span> <span class="Constant">15</span><span class="Delimiter">);</span> +<span id="L336" class="LineNr">336 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> <span class="Constant">4</span><span class="Delimiter">,</span> <span class="Constant">16</span><span class="Delimiter">);</span> <span id="L337" class="LineNr">337 </span> reagent x<span class="Delimiter">(</span><span class="Constant">"1:array:<a href='043space.cc.html#L101'>address</a>:num"</span><span class="Delimiter">);</span> <span class="Comment">// 3 types, but not a static array</span> <span id="L338" class="LineNr">338 </span> <a href='012transform.cc.html#L91'>populate_value</a><span class="Delimiter">(</span>x<span class="Delimiter">);</span> <span id="L339" class="LineNr">339 </span> <a href='002test.cc.html#L31'>CHECK_EQ</a><span class="Delimiter">(</span><a href='032array.cc.html#L319'>array_length</a><span class="Delimiter">(</span>x<span class="Delimiter">),</span> <span class="Constant">3</span><span class="Delimiter">);</span> @@ -464,35 +467,35 @@ if ('onhashchange' in window) { <span id="L400" class="LineNr">400 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L401" class="LineNr">401 </span>PUT_INDEX<span class="Delimiter">,</span> <span id="L402" class="LineNr">402 </span><span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -<span id="L403" class="LineNr">403 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"put-index"</span><span class="Delimiter">,</span> PUT_INDEX<span class="Delimiter">);</span> +<span id="L403" class="LineNr">403 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Recipe_ordinal</span><span class="Delimiter">,</span> <span class="Constant">"put-index"</span><span class="Delimiter">,</span> PUT_INDEX<span class="Delimiter">);</span> <span id="L404" class="LineNr">404 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L405" class="LineNr">405 </span><span class="Normal">case</span> PUT_INDEX: <span class="Delimiter">{</span> <span id="L406" class="LineNr">406 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">3</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L407" class="LineNr">407 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'put-index' expects exactly 3 ingredients in '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L407" class="LineNr">407 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'put-index' expects exactly 3 ingredients in '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L408" class="LineNr">408 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L409" class="LineNr">409 </span> <span class="Delimiter">}</span> <span id="L410" class="LineNr">410 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> base = inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L411" class="LineNr">411 </span> <span class="Comment">// Update PUT_INDEX base in Check</span> <span id="L412" class="LineNr">412 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_array<span class="Delimiter">(</span>base<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L413" class="LineNr">413 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'put-index' on a non-array '"</span> << base<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L413" class="LineNr">413 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'put-index' on a non-array '"</span> << base<span class="Delimiter">.</span>original_string << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L414" class="LineNr">414 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L415" class="LineNr">415 </span> <span class="Delimiter">}</span> <span id="L416" class="LineNr">416 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> index = inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L417" class="LineNr">417 </span> <span class="Comment">// Update PUT_INDEX index in Check</span> <span id="L418" class="LineNr">418 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_number<span class="Delimiter">(</span>index<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L419" class="LineNr">419 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"second ingredient of 'put-index' should have type 'number', but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L419" class="LineNr">419 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"second ingredient of 'put-index' should have type 'number', but got '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L420" class="LineNr">420 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L421" class="LineNr">421 </span> <span class="Delimiter">}</span> <span id="L422" class="LineNr">422 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> value = inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">2</span><span class="Delimiter">);</span> <span id="L423" class="LineNr">423 </span> <span class="Comment">// Update PUT_INDEX value in Check</span> <span id="L424" class="LineNr">424 </span> reagent<span class="Comment">/*</span><span class="Comment">local</span><span class="Comment">*/</span> element<span class="Delimiter">(</span><a href='032array.cc.html#L299'>copy_array_element</a><span class="Delimiter">(</span>base<span class="Delimiter">.</span>type<span class="Delimiter">));</span> <span id="L425" class="LineNr">425 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!types_coercible<span class="Delimiter">(</span>element<span class="Delimiter">,</span> value<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L426" class="LineNr">426 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'put-index "</span> << base<span class="Delimiter">.</span>original_string << <span class="Constant">", "</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string << <span class="Constant">"' should store "</span> << names_to_string_without_quotes<span class="Delimiter">(</span>element<span class="Delimiter">.</span>type<span class="Delimiter">)</span> << <span class="Constant">" but '"</span> << value<span class="Delimiter">.</span>name << <span class="Constant">"' has type "</span> << names_to_string_without_quotes<span class="Delimiter">(</span>value<span class="Delimiter">.</span>type<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L426" class="LineNr">426 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'put-index "</span> << base<span class="Delimiter">.</span>original_string << <span class="Constant">", "</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>original_string << <span class="Constant">"' should store "</span> << names_to_string_without_quotes<span class="Delimiter">(</span>element<span class="Delimiter">.</span>type<span class="Delimiter">)</span> << <span class="Constant">" but '"</span> << value<span class="Delimiter">.</span>name << <span class="Constant">"' has type "</span> << names_to_string_without_quotes<span class="Delimiter">(</span>value<span class="Delimiter">.</span>type<span class="Delimiter">)</span> << <span class="cSpecial">'\n'</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L427" class="LineNr">427 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L428" class="LineNr">428 </span> <span class="Delimiter">}</span> <span id="L429" class="LineNr">429 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>empty<span class="Delimiter">())</span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span class="Comment">// no more checks necessary</span> <span id="L430" class="LineNr">430 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name != inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>name<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L431" class="LineNr">431 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"product of 'put-index' must be first ingredient '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>original_string << <span class="Constant">"', but got '"</span> << inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L431" class="LineNr">431 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"product of 'put-index' must be first ingredient '"</span> << inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>original_string << <span class="Constant">"', but got '"</span> << inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>original_string << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L432" class="LineNr">432 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L433" class="LineNr">433 </span> <span class="Delimiter">}</span> <span id="L434" class="LineNr">434 </span> <span class="Comment">// End PUT_INDEX Product Checks</span> @@ -504,14 +507,14 @@ if ('onhashchange' in window) { <span id="L440" class="LineNr">440 </span> <span class="Comment">// Update PUT_INDEX base in Run</span> <span id="L441" class="LineNr">441 </span> <span class="Normal">int</span> base_address = base<span class="Delimiter">.</span>value<span class="Delimiter">;</span> <span id="L442" class="LineNr">442 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>base_address == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L443" class="LineNr">443 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"tried to access location 0 in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L443" class="LineNr">443 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"tried to access location 0 in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L444" class="LineNr">444 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L445" class="LineNr">445 </span> <span class="Delimiter">}</span> <span id="L446" class="LineNr">446 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> index = <a href='026call.cc.html#L89'>current_instruction</a><span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> <span id="L447" class="LineNr">447 </span> <span class="Comment">// Update PUT_INDEX index in Run</span> <span id="L448" class="LineNr">448 </span> vector<<span class="Normal">double</span>> index_val<span class="Delimiter">(</span>read_memory<span class="Delimiter">(</span>index<span class="Delimiter">));</span> -<span id="L449" class="LineNr">449 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> < <span class="Constant">0</span> || index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> >= <a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> base_address<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L450" class="LineNr">450 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"invalid index "</span> << no_scientific<span class="Delimiter">(</span>index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> << <span class="Constant">" in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L449" class="LineNr">449 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> < <span class="Constant">0</span> || index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span> >= <a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> base_address<span class="Delimiter">))</span> <span class="Delimiter">{</span> +<span id="L450" class="LineNr">450 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"invalid index "</span> << no_scientific<span class="Delimiter">(</span>index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">))</span> << <span class="Constant">" in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L451" class="LineNr">451 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L452" class="LineNr">452 </span> <span class="Delimiter">}</span> <span id="L453" class="LineNr">453 </span> <span class="Normal">int</span> <a href='043space.cc.html#L101'>address</a> = base_address + <span class="Comment">/*</span><span class="Comment">skip length</span><span class="Comment">*/</span><span class="Constant">1</span> + index_val<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">)</span>*size_of<span class="Delimiter">(</span><a href='032array.cc.html#L303'>array_element</a><span class="Delimiter">(</span>base<span class="Delimiter">.</span>type<span class="Delimiter">));</span> @@ -523,7 +526,7 @@ if ('onhashchange' in window) { <span id="L459" class="LineNr">459 </span> <span class="Comment">// Write Memory in PUT_INDEX in Run</span> <span id="L460" class="LineNr">460 </span> <span class="Normal">for</span> <span class="Delimiter">(</span><span class="Normal">int</span> i = <span class="Constant">0</span><span class="Delimiter">;</span> i < <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>value<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L461" class="LineNr">461 </span> <a href='003trace.cc.html#L189'>trace</a><span class="Delimiter">(</span><span class="Constant">"mem"</span><span class="Delimiter">)</span> << <span class="Constant">"storing "</span> << no_scientific<span class="Delimiter">(</span>value<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> << <span class="Constant">" in location "</span> << address+i << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> -<span id="L462" class="LineNr">462 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> address+i<span class="Delimiter">,</span> value<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> +<span id="L462" class="LineNr">462 </span> <a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> address+i<span class="Delimiter">,</span> value<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">));</span> <span id="L463" class="LineNr">463 </span> <span class="Delimiter">}</span> <span id="L464" class="LineNr">464 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L465" class="LineNr">465 </span><span class="Delimiter">}</span> @@ -566,17 +569,17 @@ if ('onhashchange' in window) { <span id="L502" class="LineNr">502 </span><span class="Delimiter">:(before "End Primitive Recipe Declarations")</span> <span id="L503" class="LineNr">503 </span>LENGTH<span class="Delimiter">,</span> <span id="L504" class="LineNr">504 </span><span class="Delimiter">:(before "End Primitive Recipe Numbers")</span> -<span id="L505" class="LineNr">505 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span> <span class="Constant">"length"</span><span class="Delimiter">,</span> LENGTH<span class="Delimiter">);</span> +<span id="L505" class="LineNr">505 </span><a href='001help.cc.html#L221'>put</a><span class="Delimiter">(</span><span class="Special">Recipe_ordinal</span><span class="Delimiter">,</span> <span class="Constant">"length"</span><span class="Delimiter">,</span> LENGTH<span class="Delimiter">);</span> <span id="L506" class="LineNr">506 </span><span class="Delimiter">:(before "End Primitive Recipe Checks")</span> <span id="L507" class="LineNr">507 </span><span class="Normal">case</span> LENGTH: <span class="Delimiter">{</span> <span id="L508" class="LineNr">508 </span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> != <span class="Constant">1</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L509" class="LineNr">509 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'length' expects exactly 2 ingredients in '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L509" class="LineNr">509 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>get<span class="Delimiter">(</span><span class="Special">Recipe</span><span class="Delimiter">,</span> r<span class="Delimiter">).</span>name<span class="Delimiter">)</span> << <span class="Constant">"'length' expects exactly 2 ingredients in '"</span> << to_original_string<span class="Delimiter">(</span>inst<span class="Delimiter">)</span> << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L510" class="LineNr">510 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L511" class="LineNr">511 </span> <span class="Delimiter">}</span> <span id="L512" class="LineNr">512 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> array = inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L513" class="LineNr">513 </span> <span class="Comment">// Update LENGTH array in Check</span> <span id="L514" class="LineNr">514 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!is_mu_array<span class="Delimiter">(</span>array<span class="Delimiter">))</span> <span class="Delimiter">{</span> -<span id="L515" class="LineNr">515 </span> <a href='003trace.cc.html#L196'>raise</a> << <span class="Constant">"tried to calculate length of non-array '"</span> << array<span class="Delimiter">.</span>original_string << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L515" class="LineNr">515 </span> <a href='003trace.cc.html#L196'>raise</a> << <span class="Constant">"tried to calculate length of non-array '"</span> << array<span class="Delimiter">.</span>original_string << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L516" class="LineNr">516 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L517" class="LineNr">517 </span> <span class="Delimiter">}</span> <span id="L518" class="LineNr">518 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> @@ -586,11 +589,11 @@ if ('onhashchange' in window) { <span id="L522" class="LineNr">522 </span> reagent<span class="Comment">/*</span><span class="Comment">copy</span><span class="Comment">*/</span> array = <a href='026call.cc.html#L89'>current_instruction</a><span class="Delimiter">().</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">);</span> <span id="L523" class="LineNr">523 </span> <span class="Comment">// Update LENGTH array in Run</span> <span id="L524" class="LineNr">524 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>array<span class="Delimiter">.</span>value == <span class="Constant">0</span><span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L525" class="LineNr">525 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"tried to access location 0 in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'</span><span class="cSpecial">\n</span><span class="Constant">"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> +<span id="L525" class="LineNr">525 </span> <a href='003trace.cc.html#L196'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span><a href='026call.cc.html#L87'>current_recipe_name</a><span class="Delimiter">())</span> << <span class="Constant">"tried to access location 0 in '"</span> << to_original_string<span class="Delimiter">(</span>current_instruction<span class="Delimiter">())</span> << <span class="Constant">"'\n"</span> << <a href='003trace.cc.html#L225'>end</a><span class="Delimiter">();</span> <span id="L526" class="LineNr">526 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L527" class="LineNr">527 </span> <span class="Delimiter">}</span> <span id="L528" class="LineNr">528 </span> products<span class="Delimiter">.</span>resize<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">);</span> -<span id="L529" class="LineNr">529 </span> products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>push_back<span class="Delimiter">(</span><a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span>Memory<span class="Delimiter">,</span> array<span class="Delimiter">.</span>value<span class="Delimiter">));</span> +<span id="L529" class="LineNr">529 </span> products<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">0</span><span class="Delimiter">).</span>push_back<span class="Delimiter">(</span><a href='001help.cc.html#L229'>get_or_insert</a><span class="Delimiter">(</span><span class="Special">Memory</span><span class="Delimiter">,</span> array<span class="Delimiter">.</span>value<span class="Delimiter">));</span> <span id="L530" class="LineNr">530 </span> <span class="Identifier">break</span><span class="Delimiter">;</span> <span id="L531" class="LineNr">531 </span><span class="Delimiter">}</span> <span id="L532" class="LineNr">532 </span> |