Next: , Previous: , Up: Redefining a Class   [Contents][Index]

8.12.2 Default Class Redefinition Behaviour

When a class is defined using define-class and the class name was previously defined, by default the new binding just replaces the old binding. This is the normal behavior for define. However if both the old and new bindings are redefinable classes (instances of <redefinable-class>), then the class will be updated in place, and its instances lazily migrated over.

The way that the class is updated and the way that the instances migrate over are of course part of the meta-object protocol. However the default behavior usually suffices, and it goes as follows.

To keep things tidy, GOOPS also needs to do a little housekeeping on methods that are associated with the redefined class.

If this class redefinition strategy strikes you as rather counter-intuitive, bear in mind that it is derived from similar behaviour in other object systems such as CLOS, and that experience in those systems has shown it to be very useful in practice.

Also bear in mind that, like most of GOOPS’ default behaviour, it can be customized…

Next: , Previous: , Up: Redefining a Class   [Contents][Index]