[squeak-dev] The Trunk: Kernel-dtl.1363.mcz

Marcel Taeumel marcel.taeumel at hpi.de
Thu Dec 10 07:07:48 UTC 2020


Hi Dave.

> The tricky part is still there - how do you arrange for the option
> blocks to be evaluated at the earliest possible time, but no sooner?

Oh, the semantics would stay as you proposed. But for the future, there would we a direct reference from DoItFirst to the "helper classes". At the moment, you leak the implementation details #reevaluateDebug and #reevaluateCwd outside DoItFirst. With just this little indirection, that leak would disappear:

DoItFirst class >> startUpFromDelay

   self reevaluateDebug.

DoItFirst class >> startUpFromFileDirectory

   self reevaluateCwd.

Best,
Marcel
Am 09.12.2020 20:59:42 schrieb David T. Lewis <lewis at mail.msen.com>:
Hi Marcel,

On Wed, Dec 09, 2020 at 11:21:15AM +0100, Marcel Taeumel wrote:
> Hi David.
>
> Thanks for working on this! :-)
>
> That special case in "Delay" reminds me of the suggestion to just put "DoItFirst" at a more sensible place in the start-up list. But then it would not be "do it first" anymore. :-D Same for FileDirectory.
>

Pretty much everything I tried needed a bit of hackery someplace,
and in the end it seemed simplest to do everything from the first
position in the startup list, with whatever minimal hacks were needed
to make this work.

I found that the only command option that could not be processed from
the first entry in the startup list was --debug. It works when run after
the Delay startup, but not before. So I arranged for the command "action"
to be registered in the DoItFirst startup, but not actually invoked until
the end of the Delay startup.

The FileDirectory hack is not strictly required, but without it the --cwd
setting gets reset to the normal default later in the startup processing.
Thus it would be active for e.g. any --doit options, but would be reset
by the time the image finishes startup processing. Arguably that behavior
might be considered more correct, but it would be confusing to someone
who specified a --cwd option and expected it to take effect for the
image overall. The "solution" was to add a second invocation of the
--cwd option at the end of the FileDirectory startup.

> What about a little bit more "double dispatch"?
>
> (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit startUpFromDelay ].
>
> (Smalltalk classNamed: #DoItFirst) ifNotNil: [ :doit | doit startUpFromFileDirectory ].
>

The tricky part is still there - how do you arrange for the option
blocks to be evaluated at the earliest possible time, but no sooner?

Dave


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


More information about the Squeak-dev mailing list