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

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Sun Jun 12 19:26:55 UTC 2022


Ha! That was inspired by Object >> #copy:


Object >> copy
"Answer another instance just like the receiver. Subclasses typically override postCopy; they typically do not override shallowCopy."

^self shallowCopy postCopy


I will make this more explicit by extracting "self copy refreshContexts" to "self freshCopy". :-)


Best,

Christoph

________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Jakob Reschke <jakres+squeak at gmail.com>
Gesendet: Sonntag, 12. Juni 2022 20:34:57
An: squeak-dev at lists.squeakfoundation.org
Betreff: Re: [squeak-dev] The Inbox: Kernel-ct.1481.mcz

    self copy refreshContexts signal

I know that refreshContexts in its current implementation will explicitly return self, but should we rely on this or not better use a cascade here?

    self copy refreshContexts; signal

Am So., 12. Juni 2022 um 17:28 Uhr schrieb <commits at source.squeak.org<mailto:commits at source.squeak.org>>:
A new version of Kernel was added to project The Inbox:
http://source.squeak.org/inbox/Kernel-ct.1481.mcz

==================== Summary ====================

Name: Kernel-ct.1481
Author: ct
Time: 12 June 2022, 5:27:48.147094 pm
UUID: 4fd2a361-2b3b-474c-9b86-3a899e25a8e0
Ancestors: Kernel-ct.1480

Revises Exception>>signal to copy all exception-specific state when resignaling an already signaled exception.

Thanks to Jaromir (jar)!

See: https://lists.squeakfoundation.org/pipermail/squeak-dev/2022-June/220989.html

=============== Diff against Kernel-ct.1480 ===============

Item was added:
+ ----- Method: Exception>>refreshContexts (in category 'copying') -----
+ refreshContexts
+
+       signalContext := handlerContext := outerContext := nil.
+ !

Item was changed:
  ----- Method: Exception>>signal (in category 'signaling') -----
  signal
+       "Ask handler contexts in the sender chain to handle this signal.  The default is to evaluate my defaultAction and return the result.
+       Sending #signal to an already signaled exception generates a fresh copy of the receiver."
+
+       signalContext ifNotNil: [^self copy refreshContexts signal].
-       "Ask ContextHandlers in the sender chain to handle this signal.  The default is to execute and return my defaultAction.
-       Sending #signal to an already signaled exception generates a new exception of the same type with the same messageText"
-
-       signalContext ifNotNil: [^self class signal: messageText].
        signalContext := thisContext contextTag.
        ^(thisContext nextHandlerContextForSignal: self) handleSignal: self!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220612/3dd84109/attachment.html>


More information about the Squeak-dev mailing list