[Cuis-dev] Code duplication around unwinding

Jaromir Matas mail at jaromir.net
Thu Feb 2 10:28:23 PST 2023


Hi Hernán,

Thanks for your message!

> I'll take a look at the code you sent but I prefer for Juan to return to integrate it

… of course, there’s no rush, the duplication has been around for 20 years :D

Most of all, I’m interested in your opinions. As an example, I find this call sequence desperately begging for simplification:

Exception>>resume: --> resumeUnchecked: --> resumeEvaluating: --> Context>>returnEvaluating: --> resumeEvaluating:

I mean: in order to resume from an exception you have to traverse four other methods rather than just getting it done in Exception>>resume: as was originally implemented in Squeak 2.8 through 3.5. My aim is to get back to this design - unless I’ve missed some fundamental reason why not to. Any feedback *very* welcome.

Thanks again,


--

Jaromír Matas

mail at jaromir.net


From: Hernán Wilkinson<mailto:hernan.wilkinson at 10pines.com>
Sent: Thursday, February 2, 2023 19:00
To: Discussion of Cuis Smalltalk<mailto:cuis-dev at lists.cuis.st>
Cc: juan at cuis.st<mailto:juan at cuis.st>; Jaromir Matas<mailto:mail at jaromir.net>
Subject: Re: [Cuis-dev] Code duplication around unwinding

Hi Jaromir,
 thank you for this proposal!
 Juan is on vacation, deserved vacations :-)
 I'll take a look at the code you sent but I prefer for Juan to return to integrate it because he was more involved in the changes you sent.

 About the reason of the duplication of code you see the answer could be really simple: copy & paste!!! :-)
 I also sometimes spend time trying to understand why the code is duplicated and most of the time it is just that, copy & paste without any intention or knowledge to do it better. I mean, usually it is a human reason, not a technical one.

Cheers!
Hernan.

On Thu, Feb 2, 2023 at 1:38 PM Jaromir Matas via Cuis-dev <cuis-dev at lists.cuis.st<mailto:cuis-dev at lists.cuis.st>> wrote:
Hi Juan,

I'm enclosing a changeset for your review. I've just sent a similar suggestion to Squeak list hoping to get some feedback.

The aim is to reduce the code duplication in ContextPart>>#restart, #resume:through:, #resumeEvaluating: methods that are implementing the same unwind mechanism we already have in unwindTo:. I've always wondered why the same algorithm is duplicated so many times (it used to be in terminate too!) but never really found out.

At the same time this code duplication was introduced in Squeak 3.6, the unwind mechanism was moved from the Exception class to ContextPart and, but this is just my hypothesis, never cleaned up properly.

I'd be very thankful for your thoughts and your opinion about the enclosed changeset.

Many thanks,

Jaromir


--

Jaromír Matas

mail at jaromir.net<mailto:mail at jaromir.net>


--
Cuis-dev mailing list
Cuis-dev at lists.cuis.st<mailto:Cuis-dev at lists.cuis.st>
https://lists.cuis.st/mailman/listinfo/cuis-dev


--
Hernán Wilkinson
Agile Software Development, Teaching & Coaching
Phone: +54-011-4893-2057
Twitter: @HernanWilkinson
site: http://www.10Pines.com<http://www.10pines.com/>
Address: Alem 896, Floor 6, Buenos Aires, Argentina

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230202/793c20dd/attachment.htm>


More information about the Cuis-dev mailing list