postscript in Graphics: a question to learn more about preamble/postscript

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

postscript in Graphics: a question to learn more about preamble/postscript

espin
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?
--
Enrico Spinielli
"Do Androids dream of electric sheep?"— Philip K. Dick
"Hear and forget; see and remember;do and understand."—Mitchel Resnick

Reply | Threaded
Open this post in threaded view
|

Re: postscript in Graphics: a question to learn more about preamble/postscript

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