diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-01-26 23:47:23 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-01-26 23:47:23 -0800 |
commit | d009e158803956c76adbf8f58a62884c3e7affb3 (patch) | |
tree | b88198e28d15cd1fc064f5300365a190decc4c50 /html/075duplex_list.mu.html | |
parent | 2da43c9462c7b7c1bb78d2f2826b3b97b4874973 (diff) | |
download | mu-d009e158803956c76adbf8f58a62884c3e7affb3.tar.gz |
2605
Diffstat (limited to 'html/075duplex_list.mu.html')
-rw-r--r-- | html/075duplex_list.mu.html | 386 |
1 files changed, 193 insertions, 193 deletions
diff --git a/html/075duplex_list.mu.html b/html/075duplex_list.mu.html index 4a0abcbb..d30afff6 100644 --- a/html/075duplex_list.mu.html +++ b/html/075duplex_list.mu.html @@ -36,42 +36,42 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muData">container</span> duplex-list:_elem [ value:_elem - next:address:duplex-list:_elem - prev:address:duplex-list:_elem + next:address:shared:duplex-list:_elem + prev:address:shared:duplex-list:_elem ] <span class="Comment"># should I say in/contained-in:result, allow ingredients to refer to products?</span> -<span class="muRecipe">recipe</span> push x:_elem, in:address:duplex-list:_elem<span class="muRecipe"> -> </span>in:address:duplex-list:_elem [ +<span class="muRecipe">recipe</span> push x:_elem, in:address:shared:duplex-list:_elem<span class="muRecipe"> -> </span>in:address:shared:duplex-list:_elem [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - result:address:duplex-list:_elem<span class="Special"> <- </span>new <span class="Delimiter">{</span>(duplex-list _elem): type<span class="Delimiter">}</span> + result:address:shared:duplex-list:_elem<span class="Special"> <- </span>new <span class="Delimiter">{</span>(duplex-list _elem): type<span class="Delimiter">}</span> val:address:_elem<span class="Special"> <- </span>get-address *result, <span class="Constant">value:offset</span> *val<span class="Special"> <- </span>copy x - next:address:address:duplex-list:_elem<span class="Special"> <- </span>get-address *result, <span class="Constant">next:offset</span> + next:address:address:shared:duplex-list:_elem<span class="Special"> <- </span>get-address *result, <span class="Constant">next:offset</span> *next<span class="Special"> <- </span>copy in <span class="Delimiter">{</span> <span class="muControl">break-unless</span> in - prev:address:address:duplex-list:_elem<span class="Special"> <- </span>get-address *in, <span class="Constant">prev:offset</span> + prev:address:address:shared:duplex-list:_elem<span class="Special"> <- </span>get-address *in, <span class="Constant">prev:offset</span> *prev<span class="Special"> <- </span>copy result <span class="Delimiter">}</span> <span class="muControl">reply</span> result <span class="Comment"># needed explicitly because we need to replace 'in' with 'result'</span> ] -<span class="muRecipe">recipe</span> first in:address:duplex-list:_elem<span class="muRecipe"> -> </span>result:_elem [ +<span class="muRecipe">recipe</span> first in:address:shared:duplex-list:_elem<span class="muRecipe"> -> </span>result:_elem [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="muControl">reply-unless</span> in, <span class="Constant">0</span> result<span class="Special"> <- </span>get *in, <span class="Constant">value:offset</span> ] -<span class="muRecipe">recipe</span> next in:address:duplex-list:_elem<span class="muRecipe"> -> </span>result:address:duplex-list:_elem/contained-in:in [ +<span class="muRecipe">recipe</span> next in:address:shared:duplex-list:_elem<span class="muRecipe"> -> </span>result:address:shared:duplex-list:_elem/contained-in:in [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="muControl">reply-unless</span> in, <span class="Constant">0</span> result<span class="Special"> <- </span>get *in, <span class="Constant">next:offset</span> ] -<span class="muRecipe">recipe</span> prev in:address:duplex-list:_elem<span class="muRecipe"> -> </span>result:address:duplex-list:_elem/contained-in:in [ +<span class="muRecipe">recipe</span> prev in:address:shared:duplex-list:_elem<span class="muRecipe"> -> </span>result:address:shared:duplex-list:_elem/contained-in:in [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="muControl">reply-unless</span> in, <span class="Constant">0</span> @@ -84,24 +84,24 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># reserve locations 0, 1 and 2 to check for missing null check</span> <span class="Constant">1</span>:number<span class="Special"> <- </span>copy <span class="Constant">34</span> <span class="Constant">2</span>:number<span class="Special"> <- </span>copy <span class="Constant">35</span> - <span class="Constant">3</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> - <span class="Constant">3</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">3</span>:address:duplex-list:character - <span class="Constant">3</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">3</span>:address:duplex-list:character - <span class="Constant">4</span>:address:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">3</span>:address:duplex-list:character - <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">4</span>:address:duplex-list:character - <span class="Constant">4</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">4</span>:address:duplex-list:character - <span class="Constant">6</span>:character<span class="Special"> <- </span>first <span class="Constant">4</span>:address:duplex-list:character - <span class="Constant">4</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">4</span>:address:duplex-list:character - <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">4</span>:address:duplex-list:character - <span class="Constant">8</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">4</span>:address:duplex-list:character - <span class="Constant">9</span>:character<span class="Special"> <- </span>first <span class="Constant">8</span>:address:duplex-list:character - <span class="Constant">10</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">8</span>:address:duplex-list:character - <span class="Constant">11</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">8</span>:address:duplex-list:character - <span class="Constant">4</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">4</span>:address:duplex-list:character - <span class="Constant">12</span>:character<span class="Special"> <- </span>first <span class="Constant">4</span>:address:duplex-list:character - <span class="Constant">4</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">4</span>:address:duplex-list:character - <span class="Constant">13</span>:character<span class="Special"> <- </span>first <span class="Constant">4</span>:address:duplex-list:character - <span class="Constant">14</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">3</span>:address:duplex-list:character, <span class="Constant">4</span>:address:duplex-list:character + <span class="Constant">3</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> + <span class="Constant">3</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">3</span>:address:shared:duplex-list:character + <span class="Constant">3</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">3</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:address:shared:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">3</span>:address:shared:duplex-list:character + <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">4</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">4</span>:address:shared:duplex-list:character + <span class="Constant">6</span>:character<span class="Special"> <- </span>first <span class="Constant">4</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">4</span>:address:shared:duplex-list:character + <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">4</span>:address:shared:duplex-list:character + <span class="Constant">8</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">4</span>:address:shared:duplex-list:character + <span class="Constant">9</span>:character<span class="Special"> <- </span>first <span class="Constant">8</span>:address:shared:duplex-list:character + <span class="Constant">10</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">8</span>:address:shared:duplex-list:character + <span class="Constant">11</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">8</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">4</span>:address:shared:duplex-list:character + <span class="Constant">12</span>:character<span class="Special"> <- </span>first <span class="Constant">4</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">4</span>:address:shared:duplex-list:character + <span class="Constant">13</span>:character<span class="Special"> <- </span>first <span class="Constant">4</span>:address:shared:duplex-list:character + <span class="Constant">14</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">3</span>:address:shared:duplex-list:character, <span class="Constant">4</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">0</span><span class="Special"> <- </span><span class="Constant">0</span> <span class="Comment"># no modifications to null pointers</span> @@ -121,15 +121,15 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># insert 'x' after 'in'</span> -<span class="muRecipe">recipe</span> insert x:_elem, in:address:duplex-list:_elem<span class="muRecipe"> -> </span>in:address:duplex-list:_elem [ +<span class="muRecipe">recipe</span> insert x:_elem, in:address:shared:duplex-list:_elem<span class="muRecipe"> -> </span>in:address:shared:duplex-list:_elem [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - new-node:address:duplex-list:_elem<span class="Special"> <- </span>new <span class="Delimiter">{</span>(duplex-list _elem): type<span class="Delimiter">}</span> + new-node:address:shared:duplex-list:_elem<span class="Special"> <- </span>new <span class="Delimiter">{</span>(duplex-list _elem): type<span class="Delimiter">}</span> val:address:_elem<span class="Special"> <- </span>get-address *new-node, <span class="Constant">value:offset</span> *val<span class="Special"> <- </span>copy x - next-node:address:duplex-list:_elem<span class="Special"> <- </span>get *in, <span class="Constant">next:offset</span> + next-node:address:shared:duplex-list:_elem<span class="Special"> <- </span>get *in, <span class="Constant">next:offset</span> <span class="Comment"># in.next = new-node</span> - y:address:address:duplex-list:_elem<span class="Special"> <- </span>get-address *in, <span class="Constant">next:offset</span> + y:address:address:shared:duplex-list:_elem<span class="Special"> <- </span>get-address *in, <span class="Constant">next:offset</span> *y<span class="Special"> <- </span>copy new-node <span class="Comment"># new-node.prev = in</span> y<span class="Special"> <- </span>get-address *new-node, <span class="Constant">prev:offset</span> @@ -146,27 +146,27 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muScenario">scenario</span> inserting-into-duplex-list [ run [ - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:duplex-list:character <span class="Comment"># 2 points inside list</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>insert <span class="Constant">6</span>, <span class="Constant">2</span>:address:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:shared:duplex-list:character <span class="Comment"># 2 points inside list</span> + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>insert <span class="Constant">6</span>, <span class="Constant">2</span>:address:shared:duplex-list:character <span class="Comment"># check structure like before</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">3</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">6</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">8</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">9</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">10</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">2</span>:address:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">3</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">6</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">8</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">9</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">10</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">2</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">3</span><span class="Special"> <- </span><span class="Constant">5</span> <span class="Comment"># scanning next</span> @@ -182,28 +182,28 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muScenario">scenario</span> inserting-at-end-of-duplex-list [ run [ - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:duplex-list:character <span class="Comment"># 2 points inside list</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character <span class="Comment"># now at end of list</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>insert <span class="Constant">6</span>, <span class="Constant">2</span>:address:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:shared:duplex-list:character <span class="Comment"># 2 points inside list</span> + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character <span class="Comment"># now at end of list</span> + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>insert <span class="Constant">6</span>, <span class="Constant">2</span>:address:shared:duplex-list:character <span class="Comment"># check structure like before</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">3</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">6</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">8</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">9</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">10</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">2</span>:address:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">3</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">6</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">8</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">9</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">10</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">2</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">3</span><span class="Special"> <- </span><span class="Constant">5</span> <span class="Comment"># scanning next</span> @@ -219,26 +219,26 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muScenario">scenario</span> inserting-after-start-of-duplex-list [ run [ - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>insert <span class="Constant">6</span>, <span class="Constant">1</span>:address:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>insert <span class="Constant">6</span>, <span class="Constant">1</span>:address:shared:duplex-list:character <span class="Comment"># check structure like before</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">3</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">6</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">8</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">9</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">10</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">2</span>:address:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">3</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">6</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">8</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">9</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">10</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">2</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">3</span><span class="Special"> <- </span><span class="Constant">5</span> <span class="Comment"># scanning next</span> @@ -256,15 +256,15 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment">#</span> <span class="Comment"># Returns null if and only if list is empty. Beware: in that case any other</span> <span class="Comment"># pointers to the head are now invalid.</span> -<span class="muRecipe">recipe</span> remove x:address:duplex-list:_elem/contained-in:in, in:address:duplex-list:_elem<span class="muRecipe"> -> </span>in:address:duplex-list:_elem [ +<span class="muRecipe">recipe</span> remove x:address:shared:duplex-list:_elem/contained-in:in, in:address:shared:duplex-list:_elem<span class="muRecipe"> -> </span>in:address:shared:duplex-list:_elem [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="Comment"># if 'x' is null, return</span> <span class="muControl">reply-unless</span> x - next-node:address:duplex-list:_elem<span class="Special"> <- </span>get *x, <span class="Constant">next:offset</span> - prev-node:address:duplex-list:_elem<span class="Special"> <- </span>get *x, <span class="Constant">prev:offset</span> + next-node:address:shared:duplex-list:_elem<span class="Special"> <- </span>get *x, <span class="Constant">next:offset</span> + prev-node:address:shared:duplex-list:_elem<span class="Special"> <- </span>get *x, <span class="Constant">prev:offset</span> <span class="Comment"># null x's pointers</span> - tmp:address:address:duplex-list:_elem<span class="Special"> <- </span>get-address *x, <span class="Constant">next:offset</span> + tmp:address:address:shared:duplex-list:_elem<span class="Special"> <- </span>get-address *x, <span class="Constant">next:offset</span> *tmp<span class="Special"> <- </span>copy <span class="Constant">0</span> tmp<span class="Special"> <- </span>get-address *x, <span class="Constant">prev:offset</span> *tmp<span class="Special"> <- </span>copy <span class="Constant">0</span> @@ -288,21 +288,21 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muScenario">scenario</span> removing-from-duplex-list [ run [ - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:duplex-list:character <span class="Comment"># 2 points at second element</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>remove <span class="Constant">2</span>:address:duplex-list:character, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">3</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">2</span>:address:duplex-list:character, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:shared:duplex-list:character <span class="Comment"># 2 points at second element</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>remove <span class="Constant">2</span>:address:shared:duplex-list:character, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">3</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">2</span>:address:shared:duplex-list:character, <span class="Constant">0</span> <span class="Comment"># check structure like before</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">6</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">8</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">2</span>:address:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">6</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">8</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">2</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">3</span><span class="Special"> <- </span><span class="Constant">0</span> <span class="Comment"># remove returned non-null</span> @@ -316,19 +316,19 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muScenario">scenario</span> removing-from-start-of-duplex-list [ run [ - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>remove <span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">1</span>:address:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>remove <span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">1</span>:address:shared:duplex-list:character <span class="Comment"># check structure like before</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">3</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">5</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">6</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">7</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">2</span>:address:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">3</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">5</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">6</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">7</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">2</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">3</span><span class="Special"> <- </span><span class="Constant">4</span> <span class="Comment"># scanning next, skipping deleted element</span> @@ -341,23 +341,23 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muScenario">scenario</span> removing-from-end-of-duplex-list [ run [ - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">4</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">5</span>, <span class="Constant">1</span>:address:shared:duplex-list:character <span class="Comment"># delete last element</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>remove <span class="Constant">2</span>:address:duplex-list:character, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">3</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">2</span>:address:duplex-list:character, <span class="Constant">0</span> + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>remove <span class="Constant">2</span>:address:shared:duplex-list:character, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">3</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">2</span>:address:shared:duplex-list:character, <span class="Constant">0</span> <span class="Comment"># check structure like before</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">6</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">8</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">2</span>:address:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>copy <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">4</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">5</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">6</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>prev <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">7</span>:character<span class="Special"> <- </span>first <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">8</span>:boolean<span class="Special"> <- </span>equal <span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">2</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">3</span><span class="Special"> <- </span><span class="Constant">0</span> <span class="Comment"># remove returned non-null</span> @@ -371,8 +371,8 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muScenario">scenario</span> removing-from-singleton-list [ run [ - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>remove <span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">1</span>:address:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">3</span>, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>remove <span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">1</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">1</span><span class="Special"> <- </span><span class="Constant">0</span> <span class="Comment"># back to an empty list</span> @@ -381,16 +381,16 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="Comment"># remove values between 'start' and 'end' (both exclusive)</span> <span class="Comment"># also clear pointers back out from start/end for hygiene</span> -<span class="muRecipe">recipe</span> remove-between start:address:duplex-list:_elem, end:address:duplex-list:_elem/contained-in:start<span class="muRecipe"> -> </span>start:address:duplex-list:_elem [ +<span class="muRecipe">recipe</span> remove-between start:address:shared:duplex-list:_elem, end:address:shared:duplex-list:_elem/contained-in:start<span class="muRecipe"> -> </span>start:address:shared:duplex-list:_elem [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="muControl">reply-unless</span> start <span class="Comment"># start->next->prev = 0</span> <span class="Comment"># start->next = end</span> - next:address:address:duplex-list:_elem<span class="Special"> <- </span>get-address *start, <span class="Constant">next:offset</span> + next:address:address:shared:duplex-list:_elem<span class="Special"> <- </span>get-address *start, <span class="Constant">next:offset</span> nothing-to-delete?:boolean<span class="Special"> <- </span>equal *next, end <span class="muControl">reply-if</span> nothing-to-delete? - prev:address:address:duplex-list:_elem<span class="Special"> <- </span>get-address **next, <span class="Constant">prev:offset</span> + prev:address:address:shared:duplex-list:_elem<span class="Special"> <- </span>get-address **next, <span class="Constant">prev:offset</span> *prev<span class="Special"> <- </span>copy <span class="Constant">0</span> *next<span class="Special"> <- </span>copy end <span class="muControl">reply-unless</span> end @@ -404,25 +404,25 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muScenario">scenario</span> remove-range [ <span class="Comment"># construct a duplex list with six elements [13, 14, 15, 16, 17, 18]</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">18</span>, <span class="Constant">0</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">17</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">16</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">15</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">14</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">13</span>, <span class="Constant">1</span>:address:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">18</span>, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">17</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">16</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">15</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">14</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">13</span>, <span class="Constant">1</span>:address:shared:duplex-list:character run [ <span class="Comment"># delete 16 onwards</span> <span class="Comment"># first pointer: to the third element</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>remove-between <span class="Constant">2</span>:address:duplex-list:character, <span class="Constant">0</span> + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>remove-between <span class="Constant">2</span>:address:shared:duplex-list:character, <span class="Constant">0</span> <span class="Comment"># now check the list</span> - <span class="Constant">4</span>:character<span class="Special"> <- </span>get *<span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">value:offset</span> - <span class="Constant">5</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">6</span>:character<span class="Special"> <- </span>get *<span class="Constant">5</span>:address:duplex-list:character, <span class="Constant">value:offset</span> - <span class="Constant">7</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">5</span>:address:duplex-list:character - <span class="Constant">8</span>:character<span class="Special"> <- </span>get *<span class="Constant">7</span>:address:duplex-list:character, <span class="Constant">value:offset</span> - <span class="Constant">9</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">7</span>:address:duplex-list:character + <span class="Constant">4</span>:character<span class="Special"> <- </span>get *<span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">value:offset</span> + <span class="Constant">5</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">6</span>:character<span class="Special"> <- </span>get *<span class="Constant">5</span>:address:shared:duplex-list:character, <span class="Constant">value:offset</span> + <span class="Constant">7</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">5</span>:address:shared:duplex-list:character + <span class="Constant">8</span>:character<span class="Special"> <- </span>get *<span class="Constant">7</span>:address:shared:duplex-list:character, <span class="Constant">value:offset</span> + <span class="Constant">9</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">7</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">4</span><span class="Special"> <- </span><span class="Constant">13</span> @@ -434,29 +434,29 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muScenario">scenario</span> remove-range-to-end [ <span class="Comment"># construct a duplex list with six elements [13, 14, 15, 16, 17, 18]</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">18</span>, <span class="Constant">0</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">17</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">16</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">15</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">14</span>, <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">13</span>, <span class="Constant">1</span>:address:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">18</span>, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">17</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">16</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">15</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">14</span>, <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">13</span>, <span class="Constant">1</span>:address:shared:duplex-list:character run [ <span class="Comment"># delete 15, 16 and 17</span> <span class="Comment"># first pointer: to the third element</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:shared:duplex-list:character <span class="Comment"># second pointer: to the fifth element</span> - <span class="Constant">3</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:duplex-list:character - <span class="Constant">3</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">3</span>:address:duplex-list:character - <span class="Constant">3</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">3</span>:address:duplex-list:character - <span class="Constant">3</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">3</span>:address:duplex-list:character - remove-between <span class="Constant">2</span>:address:duplex-list:character, <span class="Constant">3</span>:address:duplex-list:character + <span class="Constant">3</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">2</span>:address:shared:duplex-list:character + <span class="Constant">3</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">3</span>:address:shared:duplex-list:character + <span class="Constant">3</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">3</span>:address:shared:duplex-list:character + <span class="Constant">3</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">3</span>:address:shared:duplex-list:character + remove-between <span class="Constant">2</span>:address:shared:duplex-list:character, <span class="Constant">3</span>:address:shared:duplex-list:character <span class="Comment"># now check the list</span> - <span class="Constant">4</span>:character<span class="Special"> <- </span>get *<span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">value:offset</span> - <span class="Constant">5</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">6</span>:character<span class="Special"> <- </span>get *<span class="Constant">5</span>:address:duplex-list:character, <span class="Constant">value:offset</span> - <span class="Constant">7</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">5</span>:address:duplex-list:character - <span class="Constant">8</span>:character<span class="Special"> <- </span>get *<span class="Constant">7</span>:address:duplex-list:character, <span class="Constant">value:offset</span> - <span class="Constant">9</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">7</span>:address:duplex-list:character + <span class="Constant">4</span>:character<span class="Special"> <- </span>get *<span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">value:offset</span> + <span class="Constant">5</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">6</span>:character<span class="Special"> <- </span>get *<span class="Constant">5</span>:address:shared:duplex-list:character, <span class="Constant">value:offset</span> + <span class="Constant">7</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">5</span>:address:shared:duplex-list:character + <span class="Constant">8</span>:character<span class="Special"> <- </span>get *<span class="Constant">7</span>:address:shared:duplex-list:character, <span class="Constant">value:offset</span> + <span class="Constant">9</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">7</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">4</span><span class="Special"> <- </span><span class="Constant">13</span> @@ -468,18 +468,18 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } <span class="muScenario">scenario</span> remove-range-empty [ <span class="Comment"># construct a duplex list with six elements [13, 14, 15, 16, 17, 18]</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">14</span>, <span class="Constant">0</span> - <span class="Constant">1</span>:address:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">13</span>, <span class="Constant">1</span>:address:duplex-list:character + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">14</span>, <span class="Constant">0</span> + <span class="Constant">1</span>:address:shared:duplex-list:character<span class="Special"> <- </span>push <span class="Constant">13</span>, <span class="Constant">1</span>:address:shared:duplex-list:character run [ <span class="Comment"># delete 16 onwards</span> <span class="Comment"># first pointer: to the third element</span> - <span class="Constant">2</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:duplex-list:character - remove-between <span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">2</span>:address:duplex-list:character + <span class="Constant">2</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:shared:duplex-list:character + remove-between <span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">2</span>:address:shared:duplex-list:character <span class="Comment"># now check the list</span> - <span class="Constant">4</span>:character<span class="Special"> <- </span>get *<span class="Constant">1</span>:address:duplex-list:character, <span class="Constant">value:offset</span> - <span class="Constant">5</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:duplex-list:character - <span class="Constant">6</span>:character<span class="Special"> <- </span>get *<span class="Constant">5</span>:address:duplex-list:character, <span class="Constant">value:offset</span> - <span class="Constant">7</span>:address:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">5</span>:address:duplex-list:character + <span class="Constant">4</span>:character<span class="Special"> <- </span>get *<span class="Constant">1</span>:address:shared:duplex-list:character, <span class="Constant">value:offset</span> + <span class="Constant">5</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">1</span>:address:shared:duplex-list:character + <span class="Constant">6</span>:character<span class="Special"> <- </span>get *<span class="Constant">5</span>:address:shared:duplex-list:character, <span class="Constant">value:offset</span> + <span class="Constant">7</span>:address:shared:duplex-list:character<span class="Special"> <- </span>next <span class="Constant">5</span>:address:shared:duplex-list:character ] memory-should-contain [ <span class="Constant">4</span><span class="Special"> <- </span><span class="Constant">13</span> @@ -489,20 +489,20 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># insert list beginning at 'new' after 'in'</span> -<span class="muRecipe">recipe</span> insert-range in:address:duplex-list:_elem, start:address:duplex-list:_elem/contained-in:in<span class="muRecipe"> -> </span>in:address:duplex-list:_elem [ +<span class="muRecipe">recipe</span> insert-range in:address:shared:duplex-list:_elem, start:address:shared:duplex-list:_elem/contained-in:in<span class="muRecipe"> -> </span>in:address:shared:duplex-list:_elem [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> <span class="muControl">reply-unless</span> in <span class="muControl">reply-unless</span> start - end:address:duplex-list:_elem<span class="Special"> <- </span>copy start + end:address:shared:duplex-list:_elem<span class="Special"> <- </span>copy start <span class="Delimiter">{</span> - next:address:duplex-list:_elem<span class="Special"> <- </span>next end/insert-range + next:address:shared:duplex-list:_elem<span class="Special"> <- </span>next end/insert-range <span class="muControl">break-unless</span> next end<span class="Special"> <- </span>copy next <span class="muControl">loop</span> <span class="Delimiter">}</span> - next:address:duplex-list:_elem<span class="Special"> <- </span>next in - dest:address:address:duplex-list:_elem<span class="Special"> <- </span>get-address *end, <span class="Constant">next:offset</span> + next:address:shared:duplex-list:_elem<span class="Special"> <- </span>next in + dest:address:address:shared:duplex-list:_elem<span class="Special"> <- </span>get-address *end, <span class="Constant">next:offset</span> *dest<span class="Special"> <- </span>copy next <span class="Delimiter">{</span> <span class="muControl">break-unless</span> next @@ -515,23 +515,23 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } *dest<span class="Special"> <- </span>copy in ] -<span class="muRecipe">recipe</span> append in:address:duplex-list:_elem, new:address:duplex-list:_elem/contained-in:in<span class="muRecipe"> -> </span>in:address:duplex-list:_elem [ +<span class="muRecipe">recipe</span> append in:address:shared:duplex-list:_elem, new:address:shared:duplex-list:_elem/contained-in:in<span class="muRecipe"> -> </span>in:address:shared:duplex-list:_elem [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> - last:address:duplex-list:_elem<span class="Special"> <- </span>last in - dest:address:address:duplex-list:_elem<span class="Special"> <- </span>get-address *last, <span class="Constant">next:offset</span> + last:address:shared:duplex-list:_elem<span class="Special"> <- </span>last in + dest:address:address:shared:duplex-list:_elem<span class="Special"> <- </span>get-address *last, <span class="Constant">next:offset</span> *dest<span class="Special"> <- </span>copy new <span class="muControl">reply-unless</span> new dest<span class="Special"> <- </span>get-address *new, <span class="Constant">prev:offset</span> *dest<span class="Special"> <- </span>copy last ] -<span class="muRecipe">recipe</span> last in:address:duplex-list:_elem<span class="muRecipe"> -> </span>result:address:duplex-list:_elem [ +<span class="muRecipe">recipe</span> last in:address:shared:duplex-list:_elem<span class="muRecipe"> -> </span>result:address:shared:duplex-list:_elem [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> result<span class="Special"> <- </span>copy in <span class="Delimiter">{</span> - next:address:duplex-list:_elem<span class="Special"> <- </span>next result + next:address:shared:duplex-list:_elem<span class="Special"> <- </span>next result <span class="muControl">break-unless</span> next result<span class="Special"> <- </span>copy next <span class="muControl">loop</span> @@ -539,7 +539,7 @@ body { font-family: monospace; color: #eeeeee; background-color: #080808; } ] <span class="Comment"># helper for debugging</span> -<span class="muRecipe">recipe</span> dump-from x:address:duplex-list:_elem [ +<span class="muRecipe">recipe</span> dump-from x:address:shared:duplex-list:_elem [ <span class="Constant">local-scope</span> <span class="Constant">load-ingredients</span> $print x, <span class="Constant">[: ]</span> |