diff options
Diffstat (limited to 'html/continuation4.mu.html')
-rw-r--r-- | html/continuation4.mu.html | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/html/continuation4.mu.html b/html/continuation4.mu.html index d827031e..546a5533 100644 --- a/html/continuation4.mu.html +++ b/html/continuation4.mu.html @@ -81,22 +81,18 @@ if ('onhashchange' in window) { <span id="L21" class="LineNr">21 </span> <span class="Constant">load-ingredients</span> <span id="L22" class="LineNr">22 </span> <span class="Delimiter">{</span> <span id="L23" class="LineNr">23 </span> <span class="Conceal">¦</span> done? <span class="Special"><-</span> equal l,<span class="Constant"> 0</span> -<span id="L24" class="LineNr">24 </span> <span class="Conceal">¦</span> <span class="Comment"># Our current primitives can lead to gnarly code to ensure that we always</span> -<span id="L25" class="LineNr">25 </span> <span class="Conceal">¦</span> <span class="Comment"># statically match a continuation call with a 'return-continuation-until-mark'.</span> -<span id="L26" class="LineNr">26 </span> <span class="Conceal">¦</span> <span class="Comment"># Try to design functions to either always return or always return continuation.</span> -<span id="L27" class="LineNr">27 </span> <span class="Conceal">¦</span> <span class="Delimiter">{</span> -<span id="L28" class="LineNr">28 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment"># should we have conditional versions of return-continuation-until-mark</span> -<span id="L29" class="LineNr">29 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="Comment"># analogous to return-if and return-unless? Names get really long.</span> -<span id="L30" class="LineNr">30 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="muControl">break-unless</span> done? -<span id="L31" class="LineNr">31 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> return-continuation-until-mark<span class="Constant"> 0</span>, done? -<span id="L32" class="LineNr">32 </span> <span class="Conceal">¦</span> <span class="Conceal">¦</span> <span class="muControl">return</span><span class="Constant"> 0</span>, done? <span class="Comment"># just a guard rail; should never execute</span> -<span id="L33" class="LineNr">33 </span> <span class="Conceal">¦</span> <span class="Delimiter">}</span> -<span id="L34" class="LineNr">34 </span> <span class="Conceal">¦</span> n <span class="Special"><-</span> first l -<span id="L35" class="LineNr">35 </span> <span class="Conceal">¦</span> l <span class="Special"><-</span> <a href='064list.mu.html#L24'>rest</a> l -<span id="L36" class="LineNr">36 </span> <span class="Conceal">¦</span> return-continuation-until-mark n, done? -<span id="L37" class="LineNr">37 </span> <span class="Conceal">¦</span> <span class="muControl">loop</span> -<span id="L38" class="LineNr">38 </span> <span class="Delimiter">}</span> -<span id="L39" class="LineNr">39 </span>] +<span id="L24" class="LineNr">24 </span> <span class="Conceal">¦</span> <span class="muControl">break-if</span> done? +<span id="L25" class="LineNr">25 </span> <span class="Conceal">¦</span> n <span class="Special"><-</span> first l +<span id="L26" class="LineNr">26 </span> <span class="Conceal">¦</span> l <span class="Special"><-</span> <a href='064list.mu.html#L24'>rest</a> l +<span id="L27" class="LineNr">27 </span> <span class="Conceal">¦</span> return-continuation-until-mark n, done? +<span id="L28" class="LineNr">28 </span> <span class="Conceal">¦</span> <span class="muControl">loop</span> +<span id="L29" class="LineNr">29 </span> <span class="Delimiter">}</span> +<span id="L30" class="LineNr">30 </span> <span class="Comment"># A function that returns continuations shouldn't get the opportunity to</span> +<span id="L31" class="LineNr">31 </span> <span class="Comment"># return. Calling functions should stop calling its continuation after this</span> +<span id="L32" class="LineNr">32 </span> <span class="Comment"># point.</span> +<span id="L33" class="LineNr">33 </span> return-continuation-until-mark<span class="Constant"> -1</span>, done? +<span id="L34" class="LineNr">34 </span> assert <span class="Constant">0/false</span>, <span class="Constant">[called too many times, ran out of continuations to return]</span> +<span id="L35" class="LineNr">35 </span>] </pre> </body> </html> |