Buy GNU books!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
You can change the class of an existing instance by invoking the
change-class with two arguments: the instance
and the new class.
The default method for
change-class decides how to implement the
change of class by looking at the slot definitions for the instance's
existing class and for the new class. If the new class has slots with
the same name as slots in the existing class, the values for those slots
are preserved. Slots that are present only in the existing class are
discarded. Slots that are present only in the new class are initialized
using the corresponding slot definition's init function (see section slot-init-function).
The value of each of obj's slots is preserved only if a similarly named slot exists in new; any other slot values are discarded.
The slots in new that do not correspond to any of obj's pre-existing slots are initialized according to new's slot definitions' init functions.
Customized change of class behaviour can be implemented by defining
change-class methods that are specialized either by the class
of the instances to be modified or by the metaclass of the new class.
When a class is redefined (see section 3.8 Redefining a Class), and the default
class redefinition behaviour is not overridden, GOOPS (eventually)
change-class generic function for each existing
instance of the redefined class.
|webmaster||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|