The Inbox: Kernel-ct.1362.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Kernel-ct.1362.mcz

commits-2
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!


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Kernel-ct.1362.mcz

Eliot Miranda-2
Hi Christoph,

On Tue, Nov 3, 2020 at 1:29 PM <[hidden email]> 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


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Kernel-ct.1362.mcz

timrowledge


> On 2020-11-03, at 3:06 PM, Eliot Miranda <[hidden email]> wrote:
>
> Go forth and be prolix :-)

Wasn't he the wordy argumentative one in the Asterix the Gaul books? Had a (very) long running argument with Otiose the Roman?

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Cap'n!  The spellchecker kinna take this abuse!



Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Kernel-ct.1362.mcz

Eliot Miranda-2


On Wed, Nov 4, 2020 at 9:43 AM tim Rowledge <[hidden email]> wrote:


> On 2020-11-03, at 3:06 PM, Eliot Miranda <[hidden email]> wrote:
>
> Go forth and be prolix :-)

Wasn't he the wordy argumentative one in the Asterix the Gaul books? Had a (very) long running argument with Otiose the Roman?

He was... best comic book series ever...


Reply | Threaded
Open this post in threaded view
|

Re: The Inbox: Kernel-ct.1362.mcz

Christoph Thiede

Go forth and be prolix :-)


+1, see Kernel-ct.1363.

best comic book series ever...

+1 :-)

Best,
Christoph

Von: Squeak-dev <[hidden email]> im Auftrag von Eliot Miranda <[hidden email]>
Gesendet: Mittwoch, 4. November 2020 21:08:58
An: The general-purpose Squeak developers list
Betreff: Re: [squeak-dev] The Inbox: Kernel-ct.1362.mcz
 


On Wed, Nov 4, 2020 at 9:43 AM tim Rowledge <[hidden email]> wrote:


> On 2020-11-03, at 3:06 PM, Eliot Miranda <[hidden email]> wrote:
>
> Go forth and be prolix :-)

Wasn't he the wordy argumentative one in the Asterix the Gaul books? Had a (very) long running argument with Otiose the Roman?

He was... best comic book series ever...


Carpe Squeak!