<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Eliot, hi all,</p>
<p><br>
</p>
<p>something that was still on my to-do list before the next release is to address the changed behavior of Context >> #ruinSimulated:contextAtEachStep:.</p>
<p><br>
</p>
<p>A short recap:</p>
<p><br>
</p>
<p></p>
<div>TestCase new</div>
<div><span style="white-space:pre"></span>assert: thisContext</div>
<div><span style="white-space:pre"></span>equals: (thisContext runSimulated: [thisContext sender] contextAtEachStep: [:x|])</div>
<p><span></span><br>
</p>
<p>This assertion passes in Squeak 5.3, but since I have changed the behavior of #runSimulated:..., you have to insert a second "sender" inside the simulated block.<span><span></span></span></p>
<p><br>
</p>
<p>Question: Do you think this breaking change is fine (because without it, we were not able to detect any of the non-local returns? And is this change important enough to be noted in the release notes? :-)</p>
<p><br>
</p>
<p>Best,</p>
<p>Christoph</p>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Thiede, Christoph<br>
<b>Gesendet:</b> Dienstag, 3. November 2020 22:28:13<br>
<b>An:</b> Eliot Miranda<br>
<b>Betreff:</b> AW: [squeak-dev] The Trunk: Kernel-eem.1360.mcz</font>
<div> </div>
</div>
<div><style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Hi Eliot,</p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">if you executed some block using the old #runSimulated: version, there was literally no difference that could be observed from within the block:</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;"></span></p>
<div>thisContext runSimulated: [thisContext sender] contextAtEachStep: [:ctxt|]. "UndefinedObject>>DoIt"</div>
<div>[thisContext sender] value. "UndefinedObject>>DoIt"</div>
<p></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">With my version, this transparency does no longer persist:</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;"><span>thisContext runSimulated: [thisContext sender] contextAtEachStep: [:ctxt|]. "FullBlockClosure(BlockClosure)>>ensure:"</span><br>
</span></p>
<p><span style="font-size: 12pt;"><span><br>
</span></span></p>
<p><span style="font-size: 12pt;"><span>Well, you could argue that this would be the price for handling exceptions and all you need to do to fix the existing implementation would be to append one additional #sender call to "thisContext":</span></span></p>
<p><span style="font-size: 12pt;"><span><br>
</span></span></p>
<p><span style="font-size: 12pt;"><span><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">thisContext runSimulated:
 [thisContext sender sender] contextAtEachStep: [:ctxt|]. "UndefinedObject>>DoIt"</span><br>
</span></span></p>
<p><span style="font-size: 12pt;"><span><br>
</span></span></p>
<p><span style="font-size: 12pt;"><span>However, this violates the principle of simulation to be invisible to the code being simulated (or maybe not being similated but executed regularly instead).
<span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
That's pretty sad ... </span>Or am I wrong with this principle?</span></span></p>
<p><span style="font-size: 12pt;"><span><br>
</span></span></p>
<p><span style="font-size: 12pt;"><span>And there is even another, much more severe issue.</span></span></p>
<p>In the past, this worked, of course:</p>
<p><br>
</p>
<p><span><span>(thisContext sender runSimulated: [thisContext sender] contextAtEachStep: [:ctxt|]) selector "<span>#evaluateCue:ifFail:"</span></span></span><br>
</p>
<p><span><br>
</span></p>
<p><span>Now let's retry this sample for my ill-conveived change, so I'm adding a #sender call to "thisContext", and will be the output?</span></p>
<p><span><br>
</span></p>
<p><span><span>(thisContext sender runSimulated: [thisContext sender sender] contextAtEachStep: [:ctxt|]) selector "Compiler>>evaluateCue:ifFail:"</span><br>
</span></p>
<p><span><br>
</span></p>
<p><span>Panic! After performing #runSimulated:contextAtEachStep:, the execution won't continue on the calling method, but on the Context receiver instance which <span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">#runSimulated:contextAtEachStep:
 was sent to!</span></span></p>
<p><span>I'm going to push a fix for the latter issue right now, but still, I'm not sure whether we want to lose the simulator transparency here, see above ...</span></p>
<p><span style="font-size: 12pt;"><br>
</span></p>
<p><span style="font-size: 12pt;">> </span><span style="font-size: 12pt;">Hey, did you try the mandala example I added to Context class>>#runSimulated: ?  So cool :-) (not that one can squash fillWhite, but that it is so fast).</span><br>
</p>
<p><span style="font-size: 12pt;"><span><br>
</span></span></p>
<p><span style="font-size: 12pt;"><span>Really cool :-) The TimeProfileBrowser says that 75% of time is spent in #<span>isPrimFailToken:, by the way. Any chance to make this even faster? :D</span></span></span></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div name="divtagdefaultwrapper" style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:; margin:0">
<div>
<div class="_rp_T4" id="Item.MessagePartBody">
<div class="_rp_U4 ms-font-weight-regular ms-font-color-neutralDark rpHighlightAllClass rpHighlightBodyClass" id="Item.MessageUniqueBody" style="font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont">
<div dir="ltr">
<div id="divtagdefaultwrapper"><font face="Calibri,Helvetica,sans-serif,EmojiFont,Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols">
<div id="Signature">
<div style="margin:0px"><font style="font-family:Calibri,Arial,Helvetica,sans-serif,serif,EmojiFont">
<div><font size="3" color="black"><span style="font-size:12pt"><a href="http://www.hpi.de/" target="_blank" rel="noopener noreferrer" id="LPNoLP"><font size="2"><span id="LPlnk909538"><font color="#757B80"></font></span></font></a></span></font></div>
</font></div>
</div>
</font></div>
</div>
</div>
</div>
<div class="_rp_T4" id="Item.MessagePartBody"><br>
</div>
<div class="_rp_T4" id="Item.MessagePartBody">
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
<span style="font-size: 12pt;">PS: You sent me this message off-list, if this was not intended, please feel free to reply on-list again :-)</span><br>
</p>
<p style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 16px;">
<span style="font-size: 12pt;"><br>
</span></p>
Best,</div>
<div class="_rp_T4" id="Item.MessagePartBody">Christoph</div>
</div>
<div><font size="2" color="#808080"></font></div>
</div>
</div>
</div>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>Von:</b> Eliot Miranda <eliot.miranda@gmail.com><br>
<b>Gesendet:</b> Montag, 2. November 2020 22:08:11<br>
<b>An:</b> Thiede, Christoph<br>
<b>Betreff:</b> Re: [squeak-dev] The Trunk: Kernel-eem.1360.mcz</font>
<div> </div>
</div>
<div>Hi Christoph,
<div dir="ltr"><br>
<blockquote type="cite">On Nov 2, 2020, at 10:36 AM, Thiede, Christoph <Christoph.Thiede@student.hpi.uni-potsdam.de> wrote:<br>
<br>
</blockquote>
</div>
<blockquote type="cite">
<div dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Hi Eliot,</p>
<p><br>
</p>
<p>I already had noticed the broken tests but did not yet complete the work on it. I now realize that the old version of #runSimulated:...: had a real relation to the receiver instance of the Context invoked on and things like this no longer work:</p>
</div>
<blockquote style="margin:0 0 0 40px; border:none; padding:0px">
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span>thisContext sender runSimulated: [thisContext sender] contextAtEachStep: [:x|]</span></p>
</div>
</blockquote>
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>In fact, my new proposed version is nearly static, and I admit it's a pity to lose this option.</p>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
Hmm, I don’t really understand this point.  Can you explain a bit more?  thisContext sender still exists while we run simulated with the new version so I don’t quite see why it doesn’t work.  If the intent is this:
<div><br>
</div>
<div>    | baseContext |</div>
<div>    (baseContext := <span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">thisContext) runSimulated: [</span>baseContext<span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;"> sender]
 contextAtEachStep: [:x|]</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;"><br>
</span></div>
<div><span style="font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols; font-size: 12pt;">should work right? </span></div>
<div>
<blockquote type="cite">
<div dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="font-size: 12pt;">If you remove the "thisContext sender" from the other users of #runSimulated:contextAtEachStep:, the stack frame won't be preserved during the simulation of aBlock.</span></p>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
Which context isn’t preserved?</div>
<div><br>
<blockquote type="cite">
<div dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="font-size: 12pt;">If you like to rework it, I'll hand over it to you with pleasure because this task got larger than I would have assumed; otherwise, please let me know, and I broke it, so I'll fix it, too. :-)</span></p>
</div>
</div>
</div>
</blockquote>
<div><br>
</div>
I wish I had the time!  What u like in the current state of affairs is that all the tests are green.  That’s good enough for me for now.</div>
<div><br>
</div>
<div>Hey, did you try the mandala example I added to Context class>>#runSimulated: ?  So cool :-) (not that one can squash fillWhite, but that it is so fast).</div>
<div><br>
<blockquote type="cite">
<div dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<div dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span style="font-size: 12pt;">Best,</span></p>
<p>Christoph</p>
<br>
<div style="color:rgb(0,0,0)">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Eliot Miranda <eliot.miranda@gmail.com><br>
<b>Gesendet:</b> Montag, 2. November 2020 19:15 Uhr<br>
<b>An:</b> Thiede, Christoph<br>
<b>Betreff:</b> Re: [squeak-dev] The Trunk: Kernel-eem.1360.mcz</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:large">Hi Christoph,</div>
<div class="gmail_default" style="font-size:large"><br>
</div>
<div class="gmail_default" style="font-size:large">   I found the bug in the odl code.  It was the use of thisContext sender runSimulated: ... instead of thisContext runSimulated:.  Now all the tests pass.  Thanks for pushing to get this working.  It's an important
 and beautiful facility.</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, Nov 2, 2020 at 10:11 AM <<a href="mailto:commits@source.squeak.org">commits@source.squeak.org</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left-width:1px; border-left-style:solid; border-left-color:rgb(204,204,204); padding-left:1ex">
Eliot Miranda uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-eem.1360.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk/Kernel-eem.1360.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-eem.1360<br>
Author: eem<br>
Time: 2 November 2020, 10:10:50.874417 am<br>
UUID: 2041d4e1-746a-49f9-9098-8fbd6ba2f787<br>
Ancestors: Kernel-eem.1359, Kernel-ct.1359<br>
<br>
Merge Kernel-ct.1359 from inbox<br>
Author: ct<br>
Time: 1 November 2020, 7:50:24.183428 pm<br>
UUID: 3b12b316-79f3-de41-8765-8296d964b821<br>
Ancestors: Kernel-mt.1353<br>
<br>
Revise and extend Context #runSimulated: implementation. Remove restriction to blocks that do not have a method return. Add support for exception signaling during the execution, which caused unterminated simulation of the calling process in the past. Support
 argless contextAtEachStep blocks.<br>
<br>
Benchmarks:<br>
        code:<br>
                [Context runSimulated: [100@100 corner: 200@200]] bench<br>
        before:<br>
                16.7 ms/run<br>
        after:<br>
                19.8 ms/run<br>
I think this should be okay, given the fact that the primary purpose of simulation is providing explorability but not efficiency ...<br>
<br>
eem: Fix a bug in the use of runSimulated:contextAtEachStep:.  Presumably because of the pre-closure block model existing senders were of the form<br>
        thisContext sender<br>
                runSimulated: aBlock<br>
                contextAtEachStep: [....]<br>
but this caused the jump at the end of runSimulated:contextAtEachStep: to short-cut any processing done after runSimulated:contextAtEachStep:.  So rewrite all users of runSimulated:contextAtEachStep: in this form:<br>
        thisContext<br>
                runSimulated: aBlock<br>
                contextAtEachStep: [....]<br>
                and consequently have tallyInstruction: rallyMethods: et al answer their intended results.<br>
<br>
=============== Diff against Kernel-eem.1359 ===============<br>
<br>
Item was changed:<br>
  ----- Method: Context class>>runSimulated: (in category 'simulation') -----<br>
  runSimulated: aBlock<br>
+       "Simulate the execution of aBlock, until it ends or is curtailed. Answer the result it returns."<br>
-       "Simulate the execution of the argument, current. Answer the result it <br>
-       returns."<br>
<br>
+       ^thisContext<br>
-       ^ thisContext sender<br>
                runSimulated: aBlock<br>
+               contextAtEachStep: []<br>
-               contextAtEachStep: [:ignored]<br>
<br>
        "Context runSimulated: [Pen new defaultNib: 5; go: 100]"!<br>
<br>
Item was changed:<br>
  ----- Method: Context class>>tallyInstructions: (in category 'examples') -----<br>
  tallyInstructions: aBlock<br>
        "This method uses the simulator to count the number of occurrences of<br>
        each of the Smalltalk instructions executed during evaluation of aBlock.<br>
        Results appear in order of the byteCode set."<br>
        | tallies |<br>
        tallies := Bag new.<br>
+       thisContext<br>
-       thisContext sender<br>
                runSimulated: aBlock<br>
                contextAtEachStep:<br>
                        [:current | tallies add: current nextByte].<br>
        ^tallies sortedElements<br>
<br>
        "Context tallyInstructions: [3.14159 printString]"!<br>
<br>
Item was changed:<br>
  ----- Method: Context class>>tallyMethods: (in category 'examples') -----<br>
  tallyMethods: aBlock<br>
        "This method uses the simulator to count the number of calls on each method<br>
        invoked in evaluating aBlock. Results are given in order of decreasing counts."<br>
        | prev tallies |<br>
        tallies := Bag new.<br>
        prev := aBlock.<br>
+       thisContext<br>
-       thisContext sender<br>
                runSimulated: aBlock<br>
                contextAtEachStep:<br>
                        [:current |<br>
                        current == prev ifFalse: "call or return"<br>
                                [prev sender == nil ifFalse: "call only"<br>
                                        [tallies add: current printString].<br>
                                prev := current]].<br>
        ^tallies sortedCounts<br>
<br>
        "Context tallyMethods: [3.14159 printString]"!<br>
<br>
Item was changed:<br>
  ----- Method: Context class>>trace:on: (in category 'examples') -----<br>
  trace: aBlock on: aStream             "Context trace: [3 factorial]"<br>
        "This method uses the simulator to print calls to a file."<br>
        | prev |<br>
        prev := aBlock.<br>
+       ^thisContext<br>
-       ^ thisContext sender<br>
                runSimulated: aBlock<br>
                contextAtEachStep:<br>
                        [:current |<br>
+                       Sensor anyButtonPressed ifTrue: [^nil].<br>
+                       current == prev ifFalse:<br>
+                               [prev sender ifNil:<br>
+                                       [aStream space; nextPut: $^.<br>
+                                        self carefullyPrint: current top on: aStream].<br>
+                               aStream cr.<br>
+                               (current depthBelow: aBlock) timesRepeat: [aStream space].<br>
+                               self carefullyPrint: current receiver on: aStream.<br>
+                               aStream space; nextPutAll: current selector; flush.<br>
+                               prev := current]]!<br>
-                       Sensor anyButtonPressed ifTrue: [^ nil].<br>
-                       current == prev<br>
-                               ifFalse:<br>
-                                       [prev sender ifNil:<br>
-                                               [aStream space; nextPut: $^.<br>
-                                               self carefullyPrint: current top on: aStream].<br>
-                                       aStream cr.<br>
-                                       (current depthBelow: aBlock) timesRepeat: [aStream space].<br>
-                                       self carefullyPrint: current receiver on: aStream.<br>
-                                       aStream space; nextPutAll: current selector; flush.<br>
-                                       prev := current]]!<br>
<br>
Item was changed:<br>
  ----- Method: Context>>runSimulated:contextAtEachStep: (in category 'system simulation') -----<br>
+ runSimulated: aBlock contextAtEachStep: anotherBlock<br>
+       "Simulate the execution of the argument, aBlock, until it ends or is curtailed. If any exception is signaled during the execution, simulate it being handled on the present caller stack. Evaluate anotherBlock with the current context prior to each instruction
 executed. Answer the simulated value of aBlock."<br>
+ <br>
+       | current resume ensure |<br>
+       resume := false.<br>
- runSimulated: aBlock contextAtEachStep: block2<br>
-       "Simulate the execution of the argument, aBlock, until it ends. aBlock <br>
-       MUST NOT contain an '^'. Evaluate block2 with the current context <br>
-       prior to each instruction executed. Answer the simulated value of aBlock."<br>
-       | current |<br>
-       aBlock hasMethodReturn<br>
-               ifTrue: [self error: 'simulation of blocks with ^ can run loose'].<br>
        current := aBlock asContext.<br>
+       ensure := current insertSender: (Context contextEnsure: [resume := true]).<br>
+       ensure sender ifNil: [ensure privSender: self]. "For backward compatibility, do not fail if aBlock is dead."<br>
+       <br>
+       (anotherBlock numArgs = 0<br>
+               ifTrue: ["optimized" [resume]]<br>
+               ifFalse: ["stop execution on time, don't expose simulation details to caller"<br>
+                       [current == ensure or: <br>
+                               ["Context >> #resume:"<br>
+                               current size >= 2 and: <br>
+                                       [(current at: 2) == ensure]]]   ])<br>
-       current pushArgs: Array new from: self.<br>
-       [current == self]<br>
                whileFalse:<br>
+                       [anotherBlock cull: current.<br>
-                       [block2 value: current.<br>
                        current := current step].<br>
+       <br>
+       ^ current jump!<br>
-       ^self pop!<br>
<br>
<br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div><span style="font-size:small; border-collapse:separate">
<div>_,,,^..^,,,_<br>
</div>
<div>best, Eliot</div>
</span></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</body>
</html>