[squeak-dev] preamble

Tobias Pape Das.Linux at gmx.de
Thu Oct 17 19:02:03 UTC 2019


> On 17.10.2019, at 20:41, Jakob Reschke <forums.jakob at resfarm.de> wrote:
> 
> 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".

That's the point where you create a new update map as a checkpoint.

Best regards
	-Tobias

> 
> 
> 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
> > 
> >
> 
> 
> 




More information about the Squeak-dev mailing list