<div dir="ltr">Hi,<div><br></div><div>Sounds like a step towards restarts as found in Common Lisp, which I like.</div><div><br></div><div>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?</div><div><br></div><div>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.</div><div><br></div><div>Kind regards,</div><div>Jakob</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am Mo., 19. Apr. 2021 um 17:50 Uhr schrieb Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.de</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div id="gmail-m_-9175180079155255291__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);text-align:left" dir="ltr">
                                        Here are the two options in an exapmle:<div><br></div><div><img id="gmail-m_-91751800791552552919489427d-726d-412f-9850-6c2ec62bc9c8" src="cid:17909c7e35ecb971f161" width="706" height="451"><br></div><div></div>
                                        <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px;min-width:500px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 19.04.2021 17:48:03 schrieb <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">A new version of Kernel was added to project The Inbox:<br><a href="http://source.squeak.org/inbox/Kernel-mt.1390.mcz" target="_blank">http://source.squeak.org/inbox/Kernel-mt.1390.mcz</a><br><br>==================== Summary ====================<br><br>Name: Kernel-mt.1390<br>Author: mt<br>Time: 19 April 2021, 5:47:51.865053 pm<br>UUID: c36ac126-16de-3d41-be90-6b7fd46bc0c7<br>Ancestors: Kernel-nice.1389<br><br>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.<br><br>=============== Diff against Kernel-nice.1389 ===============<br><br>Item was added:<br>+ Notification subclass: #RestartContextRequest<br>+  instanceVariableNames: ''<br>+    classVariableNames: ''<br>+       poolDictionaries: ''<br>+         category: 'Kernel-Exceptions'!<br><br>Item was added:<br>+ ----- Method: RestartContextRequest class>>fromContextSuchThat: (in category 'as yet unclassified') -----<br>+ fromContextSuchThat: block<br>+   "Use this to restart from an arbitrary context on the stack."<br>+ <br>+  | context |<br>+  context := thisContext sender.<br>+       [context notNil] whileTrue: [<br>+                (block value: context) ifTrue: [<br>+                     ^ self new restartFrom: context].<br>+            context := context sender].<br>+  self error: 'No context found!!'.!<br><br>Item was added:<br>+ ----- Method: RestartContextRequest>>restartFrom: (in category 'as yet unclassified') -----<br>+ restartFrom: aContext<br>+ <br>+      | process actualContext unwindError |<br>+        aContext ifNil: [^ self error: 'No context to restart!!'].<br>+ <br>+       process := Processor activeProcess.<br>+ <br>+      [actualContext := process popTo: aContext.<br>+   unwindError := actualContext ~= aContext.<br>+    unwindError<br>+          ifTrue: [process resume]<br>+             ifFalse: [process restartTop; stepToSendOrReturn; resume]<br>+    ] fork.<br>+ <br>+  process suspend.!<br><br>Item was added:<br>+ ----- Method: RestartContextRequest>>restartFromHere (in category 'as yet unclassified') -----<br>+ restartFromHere<br>+      "Use this to restart from an exception handler."<br>+   self restartFrom: handlerContext.!<br><br><br></div></blockquote></div><br>
</blockquote></div>