[squeak-dev] Package postscripts

Bert Freudenberg bert at freudenbergs.de
Thu Apr 8 09:11:15 UTC 2010


On 08.04.2010, at 02:51, Levente Uzonyi wrote:
> 
> On Wed, 7 Apr 2010, Bert Freudenberg wrote:
> 
>> On 07.04.2010, at 18:36, Levente Uzonyi wrote:
>>> 
>>> On Wed, 7 Apr 2010, Alexander Lazarević wrote:
>>> 
>>>> With Morphic-kb.410 the search box in the dockbar stopped to work for me
>>> 
>>> It's an MC bug. The preamble/postscript of a package is not executed when they're unchanged and you load an mcd instead of an mcz, which is pretty common during the update process.
>> 
>> But that's the way MC works in general - only changed definitions are applied ... and consequently only changed definitions get stored in an mcd.
> 
> I expected that preambles and postscripts are always evaluated, good to know they aren't. So it's not a bug, but a feature...
> 
> 
> Levente
> 
>> 
>> It's the same for class #initialize methods, they are only executed if they were changed.
>> 
>> - Bert -


Well, to paraphrase a famous quote, any sufficiently obscure feature is indistinguishable from a bug ;)

In any case, it is obscure enough to throw people off. E.g., Alex removed some older postscript code and replaced it with his. But he can't actually be sure that code ever was executed, because someone might load a new package on top of a rather old one, skipping the intermediate versions. The only intermediate versions guaranteed to have been loaded separately are those in the config maps ... A good practice might be to allow the postscript to execute multiple times, by guarding each part with a check to see if it is necessary to run. Then you would never have to delete any part of the postscript.

- Bert -





More information about the Squeak-dev mailing list