preamble

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

preamble

marcel.taeumel
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


Reply | Threaded
Open this post in threaded view
|

Re: preamble

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

Reply | Threaded
Open this post in threaded view
|

Re: preamble

Karl Ramberg
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 <[hidden email]> 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
>
>



Reply | Threaded
Open this post in threaded view
|

Re: preamble

marcel.taeumel
In reply to this post by Levente Uzonyi
...and I made a mistake in my preamble, which made me think that it was not executed. :-D

Best,
Marcel

Am 14.10.2019 21:31:22 schrieb Levente Uzonyi <[hidden email]>:

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



Reply | Threaded
Open this post in threaded view
|

Re: preamble

Jakob Reschke
In reply to this post by Karl Ramberg
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 <[hidden email]>:
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 <[hidden email]> 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
>
>




Reply | Threaded
Open this post in threaded view
|

Re: preamble

Tobias Pape

> On 17.10.2019, at 20:41, Jakob Reschke <[hidden email]> 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 <[hidden email]>:
> 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 <[hidden email]> 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
> >
> >
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: preamble

Eliot Miranda-2
In reply to this post by Jakob Reschke
Hi Jakob,

On Thu, Oct 17, 2019 at 11:41 AM Jakob Reschke <[hidden email]> 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...

I agree; idempotency is a strong approach. And if one wants to keep old versions around for documentation purposes it's easy to turn each one into a block; the block will be compiled but not implemented.  And of course any textual change triggers evaluation of the script.  So one can add a comment saying "Adding this comment to ensure script is run next time...".

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

But one can't.  What one can do is add guards before the "business" part of the expression so that it is only evaluated in the correct context.  This is part of writing idempotent scripts. One thing that would hep is more informative comments in the empty script, and ensuring that an empty script is always displayed with a helpful comment.  Right now IIRC once3 you edit a script the helpful default comment is lost.

 


Am Mo., 14. Okt. 2019 um 22:01 Uhr schrieb karl ramberg <[hidden email]>:
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 <[hidden email]> 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
>
>





--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: preamble

Eliot Miranda-2
In reply to this post by Tobias Pape


On Thu, Oct 17, 2019 at 12:02 PM Tobias Pape <[hidden email]> wrote:

> On 17.10.2019, at 20:41, Jakob Reschke <[hidden email]> 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.

+1
 

Best regards
        -Tobias

>
>
> Am Mo., 14. Okt. 2019 um 22:01 Uhr schrieb karl ramberg <[hidden email]>:
> 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 <[hidden email]> 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
> >
> >
>
>
>





--
_,,,^..^,,,_
best, Eliot