Replacing doits in modules
Jim Benson
jb at speed.net
Mon Mar 18 16:45:02 UTC 2002
Hi,
Well, I finally bit the bullet and tried to convert some of my code to
modules in 3.3.
Let me start again. A small green puppet with a voice like Fozi Bear once
said:
"Do, or do not. There is no try"
In my case, I did not get my code to work. I have a few questions to ask.
Since doits are not allowed in the module code, how do you go about doing
things in that have been traditionally done in a changeset's postscript?
I'm the first to admit, my code does some pretty nasty things. As an
example, I want to take the base class SystemWindow, add an instance
variable to it, and then run a conversion on all existing instances to fill
in the new instance with proper values. In a previous life in the changeset
world, I would put in the postscript something along the lines of:
SystemWindow allInstances do: [ :aWindow | aWindow convertLabelToFrame ].
How do I do this in the modules world?
Which leads me to the second question:
In addition to defining classes and methods, my changesets also tend to
instantiate objects and populate them with data, again part of the changeset
postscript. I do a lot of things like create an object, and place some
bitmaps read from disk into them, or create a class variable that is a
Dictionary and fill it with defaults. How do things like that get handled in
the new world order?
Which goes into the third question:
Trying to upload my code, I get the DNU "The attempt to declare used modules
from referenced global names did not completely succeed. (There may be
Undeclared references.)". While I appreciate the candor of the error
message, I can't say that I know how to go about fixing the problem. Looking
at the code that I've filed in, it seems pretty straightforward. How do I go
about figuring out what the Undeclared references are?
Fourth question:
I file in a changeset which redefines SystemWindow>>initialize. This works
correctly. I fiddle around with several more changesets, and then redefine
SystemWindow>>initialize again. After filing in the first changeset,
SystemWindow>>initialize is redefined, both in
category: 'Morphic-Library-Windows'
and:
category: 'Project-Zurgle-Squeak Morphic Library Windows delta'
However, when the second changeset is read in, the #initialize in
'Morphic-Library-Windows' remains the same as when the first changeset was
read in, and the #initialize in 'Project-Zurgle-Squeak Morphic Library
Windows delta' changes to be the same as in the second changeset. The second
changesets #initialize never gets called, which tends to put a damper on
what would otherwise be a pretty happy afair.
Any help would be appreciated.
Thanks,
Jim
More information about the Squeak-dev
mailing list
|