[squeak-dev] postscript in Graphics: a question to learn more about preamble/postscript

Levente Uzonyi leves at elte.hu
Sun Jan 9 16:09:45 UTC 2011


On Sun, 9 Jan 2011, Enrico Spinielli wrote:

> Hi all,
> while having a look at existing postscripts I found that package
> Graphics contains
>       Color initializeNames
> and noticed that Color>>initialize has it too
> Color>>initialize
> 	"[...snip...]"
> 	self initializeIndexedColors.
> 	self initializeGrayToIndexMap.
> 	self initializeNames.
> 	self initializeHighLights.
>
> Is there any reason for this postscript?

Postscripts and preambles are used to execute code after or before loading 
a package without changing a method in the package. We use them in the 
Trunk's update process, so the postscripts and preambles of Trunk 
packages are not related to the package itself in the Trunk, but are used 
for migration from one version to another.

In this case I used a postscript to reinitialize ColorNames, because 
I changed it's representation (from OrderedCollection to Set).


Levente

> -- 
> Enrico Spinielli
> "Do Androids dream of electric sheep?"˙˙ Philip K. Dick
> "Hear and forget; see and remember;do and understand."˙˙Mitchel Resnick
>
>


More information about the Squeak-dev mailing list