[squeak-dev] The Trunk: Compiler-nice.457.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Mon Apr 19 11:10:54 UTC 2021


Hi Nicolas,


the renaming is a breaking change. We should make sure to document such changes in the changelog for the next release.

<http://www.hpi.de/>

Best,
Christoph
________________________________
Von: Squeak-dev <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von commits at source.squeak.org <commits at source.squeak.org>
Gesendet: Freitag, 16. April 2021 22:19:40
An: squeak-dev at lists.squeakfoundation.org; packages at lists.squeakfoundation.org
Betreff: [squeak-dev] The Trunk: Compiler-nice.457.mcz

Nicolas Cellier uploaded a new version of Compiler to project The Trunk:
http://source.squeak.org/trunk/Compiler-nice.457.mcz

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

Name: Compiler-nice.457
Author: nice
Time: 16 April 2021, 10:19:30.223501 pm
UUID: e2ce8f47-9ed2-0d46-aca1-1dd90ebed4b4
Ancestors: Compiler-nice.456

Rename resume: source -> retryWithNewSource: source.

The purpose of such exception handling is indeed to retry the compilation with new source.

The purpose of resume: anObject is to return anObject to the context that sent signal, that's a slightly different semantic.

It happens that if we resume after setting newSource, the signaller (Parser>>notify:at:) will effectively then tryNewSourceIfAvailable.
So effectively, resuming will end up in retrying (if there is a handler of ReparseAfterSourceEditing up the sender stack, but the Parser normally puts one).

But, even if this is HOW we implement the #retryWithNewSource:,
this is not WHAT we wish to ask to the SyntaxErrorNotification.
in other words, we shouldn't let the implementation leak in the semantics, otherwise we put the burden of understanding the implementation on the shoulders of programmers, when they could just have trusted the semantics of pseudo natural language offered by keywords.

While at it, remove the accessors of newSource.
They are not used and may be considered private.
This will reduce the unecessary polymorphism.

=============== Diff against Compiler-nice.456 ===============

Item was removed:
- ----- Method: SyntaxErrorNotification>>newSource (in category 'accessing') -----
- newSource
-        ^newSource!

Item was removed:
- ----- Method: SyntaxErrorNotification>>newSource: (in category 'accessing') -----
- newSource: aTextOrString
-        newSource := aTextOrString!

Item was removed:
- ----- Method: SyntaxErrorNotification>>resume: (in category 'accessing') -----
- resume: source
-
-        self reparse: source notifying: nil ifFail: nil.
-        ^ super resume: self defaultResumeValue!

Item was added:
+ ----- Method: SyntaxErrorNotification>>retryWithNewSource: (in category 'handling') -----
+ retryWithNewSource: source
+        "Retry the compilation with new source code.
+        Assume
+        - that the signallerContext will tryNewSourceIfAvailable
+        - the presence of a handler of ReparseAfterSourceEditing on the sender stack"
+
+        newSource := source.
+        ^ self resume!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20210419/97603b44/attachment.html>


More information about the Squeak-dev mailing list