about summary refs log tree commit diff stats
path: root/html/072scheduler.cc.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-10-22 16:27:36 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-10-22 16:27:36 -0700
commitc02478c4010d54acfaed0318a2c2c689b468e92e (patch)
tree8cdc5a15f685e4ef27205a59306f5781a10b3899 /html/072scheduler.cc.html
parent6a9d8191dfb5606f8d3630375f3ec045bd534ba3 (diff)
downloadmu-c02478c4010d54acfaed0318a2c2c689b468e92e.tar.gz
3558
Diffstat (limited to 'html/072scheduler.cc.html')
-rw-r--r--html/072scheduler.cc.html19
1 files changed, 17 insertions, 2 deletions
diff --git a/html/072scheduler.cc.html b/html/072scheduler.cc.html
index 955d5c1b..7d1734cf 100644
--- a/html/072scheduler.cc.html
+++ b/html/072scheduler.cc.html
@@ -90,8 +90,8 @@ vector&lt;routine*&gt; Routines<span class="Delimiter">;</span>
 <span class="Delimiter">:(before &quot;End Setup&quot;)</span>
 Scheduling_interval = <span class="Constant">500</span><span class="Delimiter">;</span>
 Routines<span class="Delimiter">.</span>clear<span class="Delimiter">();</span>
-<span class="Delimiter">:(replace{} &quot;void run(recipe_ordinal r)&quot;)</span>
-<span class="Normal">void</span> run<span class="Delimiter">(</span>recipe_ordinal r<span class="Delimiter">)</span> <span class="Delimiter">{</span>
+<span class="Delimiter">:(replace{} &quot;void run(const recipe_ordinal r)&quot;)</span>
+<span class="Normal">void</span> run<span class="Delimiter">(</span><span class="Normal">const</span> recipe_ordinal r<span class="Delimiter">)</span> <span class="Delimiter">{</span>
   run<span class="Delimiter">(</span><span class="Normal">new</span> routine<span class="Delimiter">(</span>r<span class="Delimiter">));</span>
 <span class="Delimiter">}</span>
 
@@ -276,6 +276,21 @@ put<span class="Delimiter">(</span>Recipe_ordinal<span class="Delimiter">,</span
 ]
 <span class="traceContains">+mem: storing 4 in location 2</span>
 
+<span class="Comment">//: type-checking for 'start-running'</span>
+
+<span class="Delimiter">:(scenario start_running_checks_types)</span>
+<span class="Special">% Hide_errors = true;</span>
+<span class="muRecipe">def</span> f1 [
+  start-running f2<span class="Delimiter">,</span> <span class="Constant">3</span>
+]
+<span class="muRecipe">def</span> f2 n:&amp;:num [
+]
+<span class="traceContains">+error: f1: ingredient 0 has the wrong type at 'start-running f2, 3'</span>
+
+<span class="Comment">// 'start-running' only uses the ingredients of the callee, not its products</span>
+<span class="Delimiter">:(before &quot;End is_indirect_call_with_ingredients Special-cases&quot;)</span>
+<span class="Normal">if</span> <span class="Delimiter">(</span>r == START_RUNNING<span class="Delimiter">)</span> <span class="Identifier">return</span> <span class="Constant">true</span><span class="Delimiter">;</span>
+
 <span class="Comment">//: more complex: refcounting management when starting up new routines</span>
 
 <span class="Delimiter">:(scenario start_running_immediately_updates_refcounts_of_ingredients)</span>