[squeak-dev] The Inbox: Kernel-mt.1390.mcz

Jakob Reschke jakres+squeak at gmail.com
Sun Apr 25 16:37:04 UTC 2021


Hi,

Sounds like a step towards restarts as found in Common Lisp, which I like.

Do I understand correctly that you denote the point of restart with
#restartFromHere (where "here" is a bit misleading since it is written in a
different block) and that you trigger the restart with
RestartContextRequest signal? And #fromContextSuchThat: does both?

Now we would just need the possibility to give the restart context a
logical identifier (a name, a purpose), and the UI to interactively choose
from those identifiers that are on the stack; then we have a higher-level
error recovery tool or a mightier debugger notifier. For API, the
equivalent would be a specialization of fromContextSuchThat:, which selects
from those identifiers. "Proceed" and "Abandon" are special cases with
implicit restart contexts: with everything left on the stack, and with
nothing left on the stack, respectively.

Kind regards,
Jakob

Am Mo., 19. Apr. 2021 um 17:50 Uhr schrieb Marcel Taeumel <
marcel.taeumel at hpi.de>:

> Here are the two options in an exapmle:
>
>
> Am 19.04.2021 17:48:03 schrieb commits at source.squeak.org <
> commits at source.squeak.org>:
> A new version of Kernel was added to project The Inbox:
> http://source.squeak.org/inbox/Kernel-mt.1390.mcz
>
> ==================== Summary ====================
>
> Name: Kernel-mt.1390
> Author: mt
> Time: 19 April 2021, 5:47:51.865053 pm
> UUID: c36ac126-16de-3d41-be90-6b7fd46bc0c7
> Ancestors: Kernel-nice.1389
>
> Proposal. Better support for hot code updates by restarting from a denoted
> (i.e. domain-specific) context (or active method). For example, this could
> be used to better update the McmUpdater as soon as a code change in itself
> is detected. Two options: either mark the restart context with an on:do:
> handler or process a query to look up that context such as by package name.
>
> =============== Diff against Kernel-nice.1389 ===============
>
> Item was added:
> + Notification subclass: #RestartContextRequest
> + instanceVariableNames: ''
> + classVariableNames: ''
> + poolDictionaries: ''
> + category: 'Kernel-Exceptions'!
>
> Item was added:
> + ----- Method: RestartContextRequest class>>fromContextSuchThat: (in
> category 'as yet unclassified') -----
> + fromContextSuchThat: block
> + "Use this to restart from an arbitrary context on the stack."
> +
> + | context |
> + context := thisContext sender.
> + [context notNil] whileTrue: [
> + (block value: context) ifTrue: [
> + ^ self new restartFrom: context].
> + context := context sender].
> + self error: 'No context found!!'.!
>
> Item was added:
> + ----- Method: RestartContextRequest>>restartFrom: (in category 'as yet
> unclassified') -----
> + restartFrom: aContext
> +
> + | process actualContext unwindError |
> + aContext ifNil: [^ self error: 'No context to restart!!'].
> +
> + process := Processor activeProcess.
> +
> + [actualContext := process popTo: aContext.
> + unwindError := actualContext ~= aContext.
> + unwindError
> + ifTrue: [process resume]
> + ifFalse: [process restartTop; stepToSendOrReturn; resume]
> + ] fork.
> +
> + process suspend.!
>
> Item was added:
> + ----- Method: RestartContextRequest>>restartFromHere (in category 'as
> yet unclassified') -----
> + restartFromHere
> + "Use this to restart from an exception handler."
> + self restartFrom: handlerContext.!
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210425/adf54ef2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 158062 bytes
Desc: not available
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210425/adf54ef2/attachment-0001.png>


More information about the Squeak-dev mailing list