www.delorie.com/gnu/docs/guile/goops_57.html   search  
 
Buy GNU books!


Goops Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.3 Class Redefinition

The default class-redefinition method, specialized for classes with the default metaclass <class>, has the following internal protocol.

[ *fixme* I'm not sure that I understand this sufficiently to explain it. Also, the internals of the default class redefinition method are extremely implementation-specific, and I'm not sure that there is that much point trying to describe the internal protocol such that it could be customized without going to look at the source code. ]

class-redefinition (old <class>) (new <class>) (method)

The default update-direct-subclass! method invokes class-redefinition recursively to handle the redefinition of the subclass.

When a class is redefined, any existing instance of the redefined class will be modified for the new class definition before the next time that any of the instance's slot is referenced or set. GOOPS modifies each instance by calling the generic function change-class. [ *fixme* Actually it sometimes calls change-class and sometimes change-object-class, and I don't understand why. ]

The default change-class method copies slot values from the old to the modified instance, and initializes new slots, as described in 3.9 Changing the Class of an Instance. After doing so, it makes a generic function invocation that can be used to customize the instance update algorithm.

change-class (old-instance <object>) (new <class>) (method)


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003