[squeak-dev] The Inbox: Kernel-ct.1362.mcz

Eliot Miranda eliot.miranda at gmail.com
Tue Nov 3 23:06:58 UTC 2020


Hi Christoph,

On Tue, Nov 3, 2020 at 1:29 PM <commits at source.squeak.org> wrote:

> A new version of Kernel was added to project The Inbox:
> http://source.squeak.org/inbox/Kernel-ct.1362.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-ct.1362
> Author: ct
> Time: 3 November 2020, 10:29:21.488637 pm
> UUID: 48a3e4c2-8aa8-414e-8d36-ccfe076c6aab
> Ancestors: Kernel-eem.1361
>
> Fixes regression in Context >> #runSimulated:contextAtEachStep: when the
> message is sent to something else than thisContext.
>
> =============== Diff against Kernel-eem.1361 ===============
>
> Item was changed:
>   ----- Method: Context>>runSimulated:contextAtEachStep: (in category
> 'system simulation') -----
>   runSimulated: aBlock contextAtEachStep: anotherBlock
>         "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."
>
>         | current resume ensure |
>         resume := false.
>         current := aBlock asContext.
> +       current privSender: self.
> +       ensure := current insertSender: (Context contextEnsure:
> +               [resume := true.
> +               ensure privSender: thisContext home sender]).
> -       ensure := current insertSender: (Context contextEnsure: [resume :=
> true]).
> -       ensure sender ifNil: [ensure privSender: self]. "For backward
> compatibility, do not fail if aBlock is dead."
>
>         (anotherBlock numArgs = 0
>                 ifTrue: ["optimized" [resume]]
>                 ifFalse: ["stop execution on time, don't expose simulation
> details to caller"
>                         [current == ensure or:
>                                 ["Context >> #resume:"
>                                 current size >= 2 and:
>                                         [(current at: 2) == ensure]]]   ])
>                 whileFalse:
>                         [anotherBlock cull: current.
>                         current := current step].
>
>         ^ current jump!
>

Please add as expansive a comment as you see fit in front of those new
lines beginning "current privSender: self".  It's important and
non-obvious.  I think only by peppering this method with comments will we
develop the correct version that can both answer results and hide the
existence of runSimulated:contextAtEachStep: from the simulation.  Once
it's working as we see fit we can prune the comments, but right now we need
to be discursive and explanatory with each other.  Go forth and be prolix
:-)


-- 
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20201103/e25cb53a/attachment.html>


More information about the Squeak-dev mailing list