diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2017-05-29 14:21:32 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2017-05-29 14:21:32 -0700 |
commit | 2c678a4e1d7f97c862342ee19cf2d6ee6e901d85 (patch) | |
tree | aa2954661eac22bd347e3fe28262a99481d42ff1 /html/057immutable.cc.html | |
parent | 0bc6fbd396f35e8dfd5cf5f5827b4ba665c3fcdf (diff) | |
download | mu-2c678a4e1d7f97c862342ee19cf2d6ee6e901d85.tar.gz |
3897 - various updates to documentation
Diffstat (limited to 'html/057immutable.cc.html')
-rw-r--r-- | html/057immutable.cc.html | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/html/057immutable.cc.html b/html/057immutable.cc.html index 215d3398..e1109712 100644 --- a/html/057immutable.cc.html +++ b/html/057immutable.cc.html @@ -78,7 +78,7 @@ if ('onhashchange' in window) { <span id="L14" class="LineNr"> 14 </span><span class="muRecipe">def</span> foo p:point<span class="muRecipe"> -> </span>p:point [ <span id="L15" class="LineNr"> 15 </span> local-scope <span id="L16" class="LineNr"> 16 </span> load-ingredients -<span id="L17" class="LineNr"> 17 </span> p<span class="Special"> <- </span><a href='001help.cc.html#L218'>put</a> p<span class="Delimiter">,</span> <span class="Constant">x:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> +<span id="L17" class="LineNr"> 17 </span> p<span class="Special"> <- </span><a href='001help.cc.html#L221'>put</a> p<span class="Delimiter">,</span> <span class="Constant">x:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> <span id="L18" class="LineNr"> 18 </span>] <span id="L19" class="LineNr"> 19 </span>$error: <span class="Constant">0</span> <span id="L20" class="LineNr"> 20 </span> @@ -92,7 +92,7 @@ if ('onhashchange' in window) { <span id="L28" class="LineNr"> 28 </span><span class="muRecipe">def</span> foo p:&:point<span class="muRecipe"> -> </span>p:&:point [ <span id="L29" class="LineNr"> 29 </span> local-scope <span id="L30" class="LineNr"> 30 </span> load-ingredients -<span id="L31" class="LineNr"> 31 </span> *p<span class="Special"> <- </span><a href='001help.cc.html#L218'>put</a> *p<span class="Delimiter">,</span> <span class="Constant">x:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> +<span id="L31" class="LineNr"> 31 </span> *p<span class="Special"> <- </span><a href='001help.cc.html#L221'>put</a> *p<span class="Delimiter">,</span> <span class="Constant">x:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> <span id="L32" class="LineNr"> 32 </span>] <span id="L33" class="LineNr"> 33 </span>$error: <span class="Constant">0</span> <span id="L34" class="LineNr"> 34 </span> @@ -120,7 +120,7 @@ if ('onhashchange' in window) { <span id="L56" class="LineNr"> 56 </span> local-scope <span id="L57" class="LineNr"> 57 </span> load-ingredients <span id="L58" class="LineNr"> 58 </span> <span class="Normal">x</span>:&:d1<span class="Special"> <- </span><span class="Normal">new</span> <span class="Constant">d1:type</span> -<span id="L59" class="LineNr"> 59 </span> *x<span class="Special"> <- </span><a href='001help.cc.html#L218'>put</a> *x<span class="Delimiter">,</span> <span class="Constant">p:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> <span class="Comment"># ignore this 'p'</span> +<span id="L59" class="LineNr"> 59 </span> *x<span class="Special"> <- </span><a href='001help.cc.html#L221'>put</a> *x<span class="Delimiter">,</span> <span class="Constant">p:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> <span class="Comment"># ignore this 'p'</span> <span id="L60" class="LineNr"> 60 </span> <span class="Identifier">return</span> <span class="Constant">36</span> <span id="L61" class="LineNr"> 61 </span>] <span id="L62" class="LineNr"> 62 </span><span class="muData">container</span> d1 [ @@ -160,7 +160,7 @@ if ('onhashchange' in window) { <span id="L96" class="LineNr"> 96 </span> <span class="Comment"># modify the element: boom</span> <span id="L97" class="LineNr"> 97 </span> <span class="Comment"># This could be ok if y contains no addresses, but we're not going to try to be that smart.</span> <span id="L98" class="LineNr"> 98 </span> <span class="Comment"># It also makes the rules easier to reason about. If it's just an ingredient, just don't try to change it.</span> -<span id="L99" class="LineNr"> 99 </span> y<span class="Special"> <- </span><a href='001help.cc.html#L218'>put</a> y<span class="Delimiter">,</span> <span class="Constant">x:offset</span><span class="Delimiter">,</span> <span class="Constant">37</span> +<span id="L99" class="LineNr"> 99 </span> y<span class="Special"> <- </span><a href='001help.cc.html#L221'>put</a> y<span class="Delimiter">,</span> <span class="Constant">x:offset</span><span class="Delimiter">,</span> <span class="Constant">37</span> <span id="L100" class="LineNr">100 </span>] <span id="L101" class="LineNr">101 </span><span class="traceContains">+error: foo: cannot modify 'y' in <a href='010vm.cc.html#L32'>instruction</a> 'y <- put y, x:offset, 37' because that would modify 'x' which is an ingredient of <a href='010vm.cc.html#L19'>recipe</a> foo but not also a product</span> <span id="L102" class="LineNr">102 </span> @@ -227,7 +227,7 @@ if ('onhashchange' in window) { <span id="L163" class="LineNr">163 </span> local-scope <span id="L164" class="LineNr">164 </span> load-ingredients <span id="L165" class="LineNr">165 </span> <span class="Normal">q</span>:&:point<span class="Special"> <- </span>copy p -<span id="L166" class="LineNr">166 </span> *q<span class="Special"> <- </span><a href='001help.cc.html#L218'>put</a> *q<span class="Delimiter">,</span> <span class="Constant">x:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> +<span id="L166" class="LineNr">166 </span> *q<span class="Special"> <- </span><a href='001help.cc.html#L221'>put</a> *q<span class="Delimiter">,</span> <span class="Constant">x:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> <span id="L167" class="LineNr">167 </span>] <span id="L168" class="LineNr">168 </span><span class="traceContains">+error: foo: cannot modify 'q' in <a href='010vm.cc.html#L32'>instruction</a> '*q <- put *q, x:offset, 34' because that would modify p which is an ingredient of <a href='010vm.cc.html#L19'>recipe</a> foo but not also a product</span> <span id="L169" class="LineNr">169 </span> @@ -241,7 +241,7 @@ if ('onhashchange' in window) { <span id="L177" class="LineNr">177 </span> local-scope <span id="L178" class="LineNr">178 </span> load-ingredients <span id="L179" class="LineNr">179 </span> <span class="Normal">q</span>:&:point<span class="Special"> <- </span>copy p -<span id="L180" class="LineNr">180 </span> *q<span class="Special"> <- </span><a href='001help.cc.html#L218'>put</a> *q<span class="Delimiter">,</span> <span class="Constant">x:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> +<span id="L180" class="LineNr">180 </span> *q<span class="Special"> <- </span><a href='001help.cc.html#L221'>put</a> *q<span class="Delimiter">,</span> <span class="Constant">x:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> <span id="L181" class="LineNr">181 </span>] <span id="L182" class="LineNr">182 </span>$error: <span class="Constant">0</span> <span id="L183" class="LineNr">183 </span> @@ -410,16 +410,16 @@ if ('onhashchange' in window) { <span id="L346" class="LineNr">346 </span> <span class="Normal">const</span> recipe& caller = get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> r<span class="Delimiter">);</span> <span id="L347" class="LineNr">347 </span> <a href='003trace.cc.html#L161'>trace</a><span class="Delimiter">(</span><span class="Constant">9991</span><span class="Delimiter">,</span> <span class="Constant">"transform"</span><span class="Delimiter">)</span> << <span class="Constant">"--- check mutability of ingredients in <a href='010vm.cc.html#L19'>recipe</a> "</span> << caller<span class="Delimiter">.</span>name << <a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> <span id="L348" class="LineNr">348 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>!caller<span class="Delimiter">.</span>has_header<span class="Delimiter">)</span> <span class="Identifier">return</span><span class="Delimiter">;</span> <span class="Comment">// skip check for old-style recipes calling next-ingredient directly</span> -<span id="L349" class="LineNr">349 </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#L138'>SIZE</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L349" class="LineNr">349 </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>caller<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L350" class="LineNr">350 </span> <span class="Conceal">¦</span> <span class="Normal">const</span> reagent& current_ingredient = caller<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span> <span id="L351" class="LineNr">351 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span><a href='057immutable.cc.html#L496'>is_present_in_products</a><span class="Delimiter">(</span>caller<span class="Delimiter">,</span> current_ingredient<span class="Delimiter">.</span>name<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Comment">// not expected to be immutable</span> <span id="L352" class="LineNr">352 </span> <span class="Conceal">¦</span> <span class="Comment">// End Immutable Ingredients Special-cases</span> <span id="L353" class="LineNr">353 </span> <span class="Conceal">¦</span> set<reagent> immutable_vars<span class="Delimiter">;</span> <span id="L354" class="LineNr">354 </span> <span class="Conceal">¦</span> immutable_vars<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>current_ingredient<span class="Delimiter">);</span> -<span id="L355" class="LineNr">355 </span> <span class="Conceal">¦</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#L138'>SIZE</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>steps<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L355" class="LineNr">355 </span> <span class="Conceal">¦</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>caller<span class="Delimiter">.</span>steps<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L356" class="LineNr">356 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">const</span> instruction& inst = caller<span class="Delimiter">.</span>steps<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span> <span id="L357" class="LineNr">357 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='057immutable.cc.html#L438'>check_immutable_ingredient_in_instruction</a><span class="Delimiter">(</span>inst<span class="Delimiter">,</span> immutable_vars<span class="Delimiter">,</span> current_ingredient<span class="Delimiter">.</span>name<span class="Delimiter">,</span> caller<span class="Delimiter">);</span> -<span id="L358" class="LineNr">358 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>operation == INDEX && <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">)</span> > <span class="Constant">1</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>name == current_ingredient<span class="Delimiter">.</span>name<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> +<span id="L358" class="LineNr">358 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>inst<span class="Delimiter">.</span>operation == INDEX && <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> && inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span><span class="Constant">1</span><span class="Delimiter">).</span>name == current_ingredient<span class="Delimiter">.</span>name<span class="Delimiter">)</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L359" class="LineNr">359 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <a href='057immutable.cc.html#L364'>update_aliases</a><span class="Delimiter">(</span>inst<span class="Delimiter">,</span> immutable_vars<span class="Delimiter">);</span> <span id="L360" class="LineNr">360 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> <span id="L361" class="LineNr">361 </span> <span class="Delimiter">}</span> @@ -450,7 +450,7 @@ if ('onhashchange' in window) { <span id="L386" class="LineNr">386 </span> <span class="Conceal">¦</span> <span class="Comment">// defined recipe</span> <span id="L387" class="LineNr">387 </span> <span class="Conceal">¦</span> set<<span class="Normal">int</span>> contained_in_product_indices = <a href='057immutable.cc.html#L395'>scan_contained_in_product_indices</a><span class="Delimiter">(</span>inst<span class="Delimiter">,</span> current_ingredient_indices<span class="Delimiter">);</span> <span id="L388" class="LineNr">388 </span> <span class="Conceal">¦</span> <span class="Normal">for</span> <span class="Delimiter">(</span>set<<span class="Normal">int</span>>::iterator p = contained_in_product_indices<span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != contained_in_product_indices<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L389" class="LineNr">389 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>*p < <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">))</span> +<span id="L389" class="LineNr">389 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>*p < <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">))</span> <span id="L390" class="LineNr">390 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> current_ingredient_and_aliases<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>*p<span class="Delimiter">));</span> <span id="L391" class="LineNr">391 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> <span id="L392" class="LineNr">392 </span> <span class="Delimiter">}</span> @@ -460,11 +460,11 @@ if ('onhashchange' in window) { <span id="L396" class="LineNr">396 </span> set<reagent> selected_ingredients<span class="Delimiter">;</span> <span id="L397" class="LineNr">397 </span> <span class="Normal">const</span> recipe& callee = get<span class="Delimiter">(</span>Recipe<span class="Delimiter">,</span> inst<span class="Delimiter">.</span>operation<span class="Delimiter">);</span> <span id="L398" class="LineNr">398 </span> <span class="Normal">for</span> <span class="Delimiter">(</span>set<<span class="Normal">int</span>>::iterator p = <a href='057immutable.cc.html#L504'>ingredient_indices</a><span class="Delimiter">.</span>begin<span class="Delimiter">();</span> p != <a href='057immutable.cc.html#L504'>ingredient_indices</a><span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">();</span> ++p<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L399" class="LineNr">399 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>*p >= <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Comment">// optional immutable ingredient</span> +<span id="L399" class="LineNr">399 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>*p >= <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span class="Comment">// optional immutable ingredient</span> <span id="L400" class="LineNr">400 </span> <span class="Conceal">¦</span> selected_ingredients<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>*p<span class="Delimiter">));</span> <span id="L401" class="LineNr">401 </span> <span class="Delimiter">}</span> <span id="L402" class="LineNr">402 </span> set<<span class="Normal">int</span>> result<span class="Delimiter">;</span> -<span id="L403" class="LineNr">403 </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#L138'>SIZE</a><span class="Delimiter">(</span>callee<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L403" class="LineNr">403 </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>callee<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L404" class="LineNr">404 </span> <span class="Conceal">¦</span> <span class="Normal">const</span> reagent& current_product = callee<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">);</span> <span id="L405" class="LineNr">405 </span> <span class="Conceal">¦</span> <span class="Normal">const</span> string_tree* contained_in_name = property<span class="Delimiter">(</span>current_product<span class="Delimiter">,</span> <span class="Constant">"contained-in"</span><span class="Delimiter">);</span> <span id="L406" class="LineNr">406 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>contained_in_name && selected_ingredients<span class="Delimiter">.</span>find<span class="Delimiter">(</span>contained_in_name<span class="Delimiter">-></span>value<span class="Delimiter">)</span> != selected_ingredients<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">())</span> @@ -489,7 +489,7 @@ if ('onhashchange' in window) { <span id="L425" class="LineNr">425 </span> local-scope <span id="L426" class="LineNr">426 </span> load-ingredients <span id="L427" class="LineNr">427 </span> <span class="Normal">p2</span>:&:test-list<span class="Special"> <- </span>test-next p <span class="Comment"># p2 is immutable</span> -<span id="L428" class="LineNr">428 </span> *p2<span class="Special"> <- </span><a href='001help.cc.html#L218'>put</a> *p2<span class="Delimiter">,</span> <span class="Constant">value:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> +<span id="L428" class="LineNr">428 </span> *p2<span class="Special"> <- </span><a href='001help.cc.html#L221'>put</a> *p2<span class="Delimiter">,</span> <span class="Constant">value:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> <span id="L429" class="LineNr">429 </span>] <span id="L430" class="LineNr">430 </span><span class="muRecipe">def</span> test-next x:&:test-list<span class="muRecipe"> -> </span>y:&:test-list/contained-in:x [ <span id="L431" class="LineNr">431 </span> local-scope @@ -501,7 +501,7 @@ if ('onhashchange' in window) { <span id="L437" class="LineNr">437 </span><span class="Delimiter">:(code)</span> <span id="L438" class="LineNr">438 </span><span class="Normal">void</span> <a href='057immutable.cc.html#L438'>check_immutable_ingredient_in_instruction</a><span class="Delimiter">(</span><span class="Normal">const</span> instruction& inst<span class="Delimiter">,</span> <span class="Normal">const</span> set<reagent>& current_ingredient_and_aliases<span class="Delimiter">,</span> <span class="Normal">const</span> string& original_ingredient_name<span class="Delimiter">,</span> <span class="Normal">const</span> recipe& caller<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L439" class="LineNr">439 </span> <span class="Comment">// first check if the instruction is directly modifying something it shouldn't</span> -<span id="L440" class="LineNr">440 </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#L138'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L440" class="LineNr">440 </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>inst<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L441" class="LineNr">441 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>has_property<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">),</span> <span class="Constant">"lookup"</span><span class="Delimiter">)</span> <span id="L442" class="LineNr">442 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> && current_ingredient_and_aliases<span class="Delimiter">.</span>find<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> != current_ingredient_and_aliases<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">())</span> <span class="Delimiter">{</span> <span id="L443" class="LineNr">443 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> string current_product_name = inst<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>name<span class="Delimiter">;</span> @@ -553,12 +553,12 @@ if ('onhashchange' in window) { <span id="L489" class="LineNr">489 </span> <span class="Conceal">¦</span> <a href='003trace.cc.html#L168'>raise</a> << <a href='013update_operation.cc.html#L25'>maybe</a><span class="Delimiter">(</span>caller<span class="Delimiter">.</span>name<span class="Delimiter">)</span> << <span class="Constant">"can't check mutability of ingredients in recipe "</span> << callee<span class="Delimiter">.</span>name << <span class="Constant">" because it uses 'next-ingredient' directly, rather than a recipe header.</span><span class="cSpecial">\n</span><span class="Constant">"</span> << end<span class="Delimiter">();</span> <span id="L490" class="LineNr">490 </span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L491" class="LineNr">491 </span> <span class="Delimiter">}</span> -<span id="L492" class="LineNr">492 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>ingredient_index >= <a href='001help.cc.html#L138'>SIZE</a><span class="Delimiter">(</span>callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span class="Comment">// optional immutable ingredient</span> +<span id="L492" class="LineNr">492 </span> <span class="Normal">if</span> <span class="Delimiter">(</span>ingredient_index >= <a href='001help.cc.html#L141'>SIZE</a><span class="Delimiter">(</span>callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">))</span> <span class="Identifier">return</span> <span class="Constant">false</span><span class="Delimiter">;</span> <span class="Comment">// optional immutable ingredient</span> <span id="L493" class="LineNr">493 </span> <span class="Identifier">return</span> <a href='057immutable.cc.html#L496'>is_present_in_products</a><span class="Delimiter">(</span>callee<span class="Delimiter">,</span> callee<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>ingredient_index<span class="Delimiter">).</span>name<span class="Delimiter">);</span> <span id="L494" class="LineNr">494 </span><span class="Delimiter">}</span> <span id="L495" class="LineNr">495 </span> <span id="L496" class="LineNr">496 </span><span class="Normal">bool</span> <a href='057immutable.cc.html#L496'>is_present_in_products</a><span class="Delimiter">(</span><span class="Normal">const</span> recipe& callee<span class="Delimiter">,</span> <span class="Normal">const</span> string& ingredient_name<span class="Delimiter">)</span> <span class="Delimiter">{</span> -<span id="L497" class="LineNr">497 </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#L138'>SIZE</a><span class="Delimiter">(</span>callee<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L497" class="LineNr">497 </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>callee<span class="Delimiter">.</span>products<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L498" class="LineNr">498 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>callee<span class="Delimiter">.</span>products<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">).</span>name == ingredient_name<span class="Delimiter">)</span> <span id="L499" class="LineNr">499 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span> <span id="L500" class="LineNr">500 </span> <span class="Delimiter">}</span> @@ -567,7 +567,7 @@ if ('onhashchange' in window) { <span id="L503" class="LineNr">503 </span> <span id="L504" class="LineNr">504 </span>set<<span class="Normal">int</span>> <a href='057immutable.cc.html#L504'>ingredient_indices</a><span class="Delimiter">(</span><span class="Normal">const</span> instruction& inst<span class="Delimiter">,</span> <span class="Normal">const</span> set<reagent>& ingredient_names<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L505" class="LineNr">505 </span> set<<span class="Normal">int</span>> result<span class="Delimiter">;</span> -<span id="L506" class="LineNr">506 </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#L138'>SIZE</a><span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> +<span id="L506" class="LineNr">506 </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>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">);</span> ++i<span class="Delimiter">)</span> <span class="Delimiter">{</span> <span id="L507" class="LineNr">507 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>is_literal<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">)))</span> <span class="Identifier">continue</span><span class="Delimiter">;</span> <span id="L508" class="LineNr">508 </span> <span class="Conceal">¦</span> <span class="Normal">if</span> <span class="Delimiter">(</span>ingredient_names<span class="Delimiter">.</span>find<span class="Delimiter">(</span>inst<span class="Delimiter">.</span>ingredients<span class="Delimiter">.</span>at<span class="Delimiter">(</span>i<span class="Delimiter">))</span> != ingredient_names<span class="Delimiter">.</span><a href='003trace.cc.html#L185'>end</a><span class="Delimiter">())</span> <span id="L509" class="LineNr">509 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> result<span class="Delimiter">.</span>insert<span class="Delimiter">(</span>i<span class="Delimiter">);</span> @@ -611,7 +611,7 @@ if ('onhashchange' in window) { <span id="L547" class="LineNr">547 </span><span class="muRecipe">def</span> test-remove x:&:test-list/contained-in:from<span class="Delimiter">,</span> from:&:test-list<span class="muRecipe"> -> </span>from:&:test-list [ <span id="L548" class="LineNr">548 </span> local-scope <span id="L549" class="LineNr">549 </span> load-ingredients -<span id="L550" class="LineNr">550 </span> *x<span class="Special"> <- </span><a href='001help.cc.html#L218'>put</a> *x<span class="Delimiter">,</span> <span class="Constant">value:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> <span class="Comment"># can modify x</span> +<span id="L550" class="LineNr">550 </span> *x<span class="Special"> <- </span><a href='001help.cc.html#L221'>put</a> *x<span class="Delimiter">,</span> <span class="Constant">value:offset</span><span class="Delimiter">,</span> <span class="Constant">34</span> <span class="Comment"># can modify x</span> <span id="L551" class="LineNr">551 </span>] <span id="L552" class="LineNr">552 </span>$error: <span class="Constant">0</span> <span id="L553" class="LineNr">553 </span> |