[squeak-dev] preamble

Jakob Reschke forums.jakob at resfarm.de
Thu Oct 17 18:41:49 UTC 2019


Is it really wise to remove the previous scripts?

Suppose I have versions 1, 2, and 3 and object state needs to be migrated
differently between each of them. If one image still has 1 loaded and is
updated directly to 3, it will miss the object state updates from 1 to 2,
or it not even be able to perform an adequate update from 2 to 3.

Shouldn't the scripts rather be idempotent? If they must run again, but the
code is the same, you could add a comment explaining the reason...

Of course you can draw a line by declaring particular earlier versions as
"unsupported".


Am Mo., 14. Okt. 2019 um 22:01 Uhr schrieb karl ramberg <
karlramberg at gmail.com>:

> So the comment on top of the preamble and post script could be something
> like code below. Could we make this comment show even in a previous made
> preamble/ post script so it is there as a reminder ?
>
> 'From Squeak5.3alpha of 14 October 2019 [latest update: #19114] on 14
> October 2019 at 9:53:39 pm'!
>
> !PackageInfo methodsFor: 'preamble/postscript' stamp: 'kfr 10/14/2019
> 21:52'!
> postscriptDefault
> ^  '"Below, add code to be run after the loading of this package.
> Postscript is only evaluated when it is different than previous version.
> That is why it is always best practice to remove its previous contents when
> editing it."'
> ! !
>
> !PackageInfo methodsFor: 'preamble/postscript' stamp: 'kfr 10/14/2019
> 21:49'!
> preambleDefault
> ^ '"Below, add code to be run before the loading of this package. Preamble
> is only evaluated when it is
> different than previous version. That is why it is always best practice to
> remove its previous contents when editing it."'
> ! !
>
>
> On Mon, Oct 14, 2019 at 9:31 PM Levente Uzonyi <leves at caesar.elte.hu>
> wrote:
>
>> These scripts, preamble and postscript are only evaluated when they are
>> different than their previous versions. That is why I always suggest
>> removing their contents when changing them.
>>
>> Levente
>>
>> On Mon, 14 Oct 2019, Marcel Taeumel wrote:
>>
>> > Well, it seems to be that a "preamble" in a package is not evaluated
>> when updating the image. Is this a bug?
>> > ChangeSet preambles also don't seem to be prepared to store a script.
>> Just a documentation string. Why is that? :-)
>> >
>> > Best,
>> > Marcel
>> >
>> >
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191017/eca74c75/attachment.html>


More information about the Squeak-dev mailing list