At 5:16 PM -0700 2/26/04, Luke Palmer wrote:
Dan Sugalski writes:
 At 2:38 PM +0100 2/26/04, Leopold Toetsch wrote:
 >Simplifies compilers:
 >
 >    newclass P1, "Foo"
 >    addattribute P1, "i"
 >    findclass I1, "Foo"
 >    new P2, I1
 >
 >    classoffset I2, P2
 >
 >In static cases, where P2 is known to be a C<Foo>, attrib #0 ("i") would
 >be always 0. That is, the C<classoffset> opcode can be omitted in that
 >case.

 That's a very rare case, honestly, and since arguably every object is
 a subclass of the base object class and people will end up sticking
 attributes and methods into the base object class it's going to
 happen anyway.

And how do we deal with an object already in existence when the base object gets an attribute added?

Right now? We corrupt all the objects and classes that descend from the class that gets the attribute added.


In the nearish future, we throw an exception.

After that, we post a notification to all child classes and walk through the PMC pools inserting the new attribute in the proper spot for the classes.

Not rocket science. (Darned *annoying*, mind, but not rocket science :)
--
                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to