[squeak-dev] Monticello postscript problem

Martin Kuball martinkuball at web.de
Fri May 8 11:57:18 UTC 2020


Hi Marcel,

Am Freitag, 8. Mai 2020, 09:17:41 CEST schrieb Marcel Taeumel:
> Hi Martin,
>
> I think that it would be better to first run all initializers and only then
> the package postscripts. I thought this happens anyway. :-)
>
> Can you point me to the source code you found?

Sure.  Look at MCPackageLoader>>basicLoad. The problem is almost at the end
with this lines:

	additions do: [:ea | ea postloadOver: (self obsoletionFor: ea)]
		displayingProgress: 'Initializing ', pkgName.

The instance variable additions holds MCDefinition objects. Mostly for the
classes but although the postscript. I replaced above lines with:

	(additions select: [:ea | ea isScriptDefinition not]) do:
		[:ea | ea postloadOver: (self obsoletionFor: ea)]
		displayingProgress: 'Initializing classes ', pkgName.

	(additions select: [:ea | ea isScriptDefinition]) do:
		[:ea | ea postloadOver: (self obsoletionFor: ea)]
		displayingProgress: 'executing postscript ', pkgName.

But it would be much nicer to either have an extra variable for the postscript
(assuming there could only be one) or make sure it always stays at the end of
the list.

>
> Best,
> Marcel
> Am 07.05.2020 21:50:28 schrieb Martin Kuball <martinkuball at web.de>:
>
> Am Donnerstag, 7. Mai 2020, 21:45:50 CEST schrieb Martin Kuball:
> > Hi all,
> >
> > I have a problem with a postscript in one of my Monticello packages. It
> > fails to execute because a class used in the script did not had it's
> > initialize method run, yet. I took a look under the hood and found, that
> > the postscript and the initializer execs are all mixed together in one
> > list. But the postscript was not at the end of this list.
> >
> > So is this a bug or is there for some reason no guarantee that the
> > postscript is run when everything else is done? I fixed this for me by
> > running twice over the list. First for the non-scripts and then for the
> > scripts. Not very pretty but seems to do the job.
> >
> > Martin
>
> I guess I should tell you that I'm using version 708 of monticello.






More information about the Squeak-dev mailing list