[Date Prev][Date Next][Thread Prev][Thread Next][Author Index][Date Index][Thread Index]
- To: <xtech>
- Subject: Static initialization
- From: Ravi Pandya <ravi>
- Date: Wed, 28 Mar 90 14:00:17 PST
The waldo maker mechanism requires some work to be done at init time
to register a maker for each waldo class. We have a mechanism that
works in Smalltalk, and MarkM & I came up with a method for
translating the subset that we currently use. I'd just like to flash
it past the rest of you for suggestions before implementing it.
Any class can implement a "initTimeNonInherited" method, which is
called by the Tester before doing anything. This translates to
top-level code, *outside function scope*, that can be used for a
limited number of purposes:
(1) Initializing class variables. An assignment to a class variable in
this code is preceded by the definition of the variable. Any class
variables not so assigned are assumed to be smalltalk-only.
This isn't quite right, because subclasses that aren't in the same
file don't get access to the class variable. We need a better way.
(2) Calling macros to set up fluid vars and such. These macros in
smalltalk are messages sends to classes, of the form
WaldoMaker WALDOMAKER: TextDoc with: DirectRecord with: NULL
which translate to
WALDOMAKER(TextDoc, DirectRecord, NULL);
and the macro is defined somewhere in a C++ only file.
I'm going to work on type converters for a day or so while I think
about this, so if anyone has any improvements I'd love to hear them.