Merge commit '58147d67806e1f54c447d7eabac35b1a5086c3a6'
[bpt/guile.git] / doc / ref / goops.texi
index 364aeeb..ce0b76b 100644 (file)
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Guile Reference Manual.
-@c Copyright (C)  2008, 2009
+@c Copyright (C)  2008, 2009, 2011
 @c   Free Software Foundation, Inc.
 @c See the file guile.texi for copying conditions.
 
@@ -45,16 +45,11 @@ module.  You can do this at the Guile REPL by evaluating:
 * Methods and Generic Functions::           
 * Inheritance::                 
 * Introspection::
-* Class Options::
-* Accessing Slots::
-* Generic Functions and Accessors::
-* Redefining a Class::
-* Changing the Class of an Instance::
 * GOOPS Error Handling::
-* Object Comparisons::
-* Cloning Objects::
-* Write and Display::
+* GOOPS Object Miscellany::
 * The Metaobject Protocol::
+* Redefining a Class::
+* Changing the Class of an Instance::
 @end menu
 
 @node Copyright Notice
@@ -98,15 +93,16 @@ that class --- like ``fields'' or ``member variables'' in other object
 oriented systems.  Each @var{slot-description} gives the name of a slot
 and optionally some ``properties'' of this slot; for example its initial
 value, the name of a function which will access its value, and so on.
-Slot descriptions and inheritance are discussed more below.  For class
-options, see @ref{Class Options}.
+Class options, slot descriptions and inheritance are discussed more
+below.
 @cindex slot
 
-@deffn syntax define-class name (super @dots{}) slot-definition @dots{} . options
+@deffn syntax define-class name (super @dots{}) @
+              slot-definition @dots{} class-option @dots{}
 Define a class called @var{name} that inherits from @var{super}s, with
-direct slots defined by @var{slot-definition}s and class options
-@var{options}.  The newly created class is bound to the variable name
-@var{name} in the current environment.
+direct slots defined by @var{slot-definition}s and @var{class-option}s.
+The newly created class is bound to the variable name @var{name} in the
+current environment.
 
 Each @var{slot-definition} is either a symbol that names the slot or a
 list,
@@ -120,8 +116,7 @@ list with an even number of elements.  The even-numbered elements of
 @var{slot-options} (counting from zero) are slot option keywords; the
 odd-numbered elements are the corresponding values for those keywords.
 
-@var{options} is a similarly structured list containing class option
-keywords and corresponding values.
+Each @var{class-option} is an option keyword and corresponding value.
 @end deffn
 
 As an example, let us define a type for representing a complex number
@@ -144,8 +139,28 @@ the predefined class @code{<complex>}; @code{<complex>} is the
 superclass of @code{<real>}, and @code{<real>} is the superclass of
 @code{<integer>}.}
 
-The possible slot and class options are described in the following
-sections.
+Slot options are described in the next section.  The possible class
+options are as follows.
+
+@deffn {class option} #:metaclass metaclass
+The @code{#:metaclass} class option specifies the metaclass of the class
+being defined.  @var{metaclass} must be a class that inherits from
+@code{<class>}.  For the use of metaclasses, see @ref{Metaobjects and
+the Metaobject Protocol} and @ref{Metaclasses}.
+
+If the @code{#:metaclass} option is absent, GOOPS reuses or constructs a
+metaclass for the new class by calling @code{ensure-metaclass}
+(@pxref{Class Definition Protocol,, ensure-metaclass}).
+@end deffn
+
+@deffn {class option} #:name name
+The @code{#:name} class option specifies the new class's name.  This
+name is used to identify the class whenever related objects - the class
+itself, its instances and its subclasses - are printed.
+
+If the @code{#:name} option is absent, GOOPS uses the first argument to
+@code{define-class} as the class name.
+@end deffn
 
 
 @node Instance Creation
@@ -168,13 +183,13 @@ creates a new @code{<my-complex>} object and binds it to the Scheme
 variable @code{c}.
 
 @deffn generic make
-@deffnx method make (class <class>) . initargs
+@deffnx method make (class <class>) initarg @dots{}
 Create and return a new instance of class @var{class}, initialized using
-@var{initargs}.
+@var{initarg} @enddots{}.
 
-In theory, @var{initargs} can have any structure that is understood by
-whatever methods get applied when the @code{initialize} generic function
-is applied to the newly allocated instance.
+In theory, @var{initarg} @dots{} can have any structure that is
+understood by whatever methods get applied when the @code{initialize}
+generic function is applied to the newly allocated instance.
 
 In practice, specialized @code{initialize} methods would normally call
 @code{(next-method)}, and so eventually the standard GOOPS
@@ -191,7 +206,7 @@ instance's class.  Any unprocessed keyword value pairs are ignored.
 @end deffn
 
 @deffn generic make-instance
-@deffnx method make-instance (class <class>) . initargs
+@deffnx method make-instance (class <class>) initarg @dots{}
 @code{make-instance} is an alias for @code{make}.
 @end deffn
 
@@ -539,9 +554,9 @@ other.  A better solution is to use virtual slots, like this:
 
 @end lisp
 
-In this class definition, the magniture @code{m} and angle @code{a}
+In this class definition, the magnitude @code{m} and angle @code{a}
 slots are virtual, and are calculated, when referenced, from the normal
-(i.e. @code{#:allocation #:instance}) slots @code{r} and @code{i}, by
+(i.e.@: @code{#:allocation #:instance}) slots @code{r} and @code{i}, by
 calling the function defined in the relevant @code{#:slot-ref} option.
 Correspondingly, writing @code{m} or @code{a} leads to calling the
 function defined in the @code{#:slot-set!} option.  Thus the
@@ -623,7 +638,7 @@ different sets of specializing argument classes; for example:
 @lisp
 (define-method (+ (x <string>) (y <string)) ...)
 (define-method (+ (x <matrix>) (y <matrix>)) ...)
-(define-method (+ (f <fish>) (b <bicyle>)) ...)
+(define-method (+ (f <fish>) (b <bicycle>)) ...)
 (define-method (+ (a <foo>) (b <bar>) (c <baz>)) ...)
 @end lisp
 
@@ -659,9 +674,9 @@ setter).  Any other previous value, including an existing generic
 function, is discarded and replaced by a new, empty generic function.
 @end deffn
 
-@deffn syntax define-method (generic parameter @dots{}) . body
+@deffn syntax define-method (generic parameter @dots{}) body @dots{}
 Define a method for the generic function or accessor @var{generic} with
-parameters @var{parameter}s and body @var{body}.
+parameters @var{parameter}s and body @var{body} @enddots{}.
 
 @var{generic} is a generic function.  If @var{generic} is a variable
 which is not yet bound to a generic function object, the expansion of
@@ -673,12 +688,12 @@ generic-with-setter object, the expansion will include a call to
 
 Each @var{parameter} must be either a symbol or a two-element list
 @code{(@var{symbol} @var{class})}.  The symbols refer to variables in
-the @var{body} that will be bound to the parameters supplied by the
+the body forms that will be bound to the parameters supplied by the
 caller when calling this method.  The @var{class}es, if present,
 specify the possible combinations of parameters to which this method
 can be applied.
 
-@var{body} is the body of the method definition.
+@var{body} @dots{} are the bodies of the method definition.
 @end deffn
 
 @code{define-method} expressions look a little like Scheme procedure
@@ -807,9 +822,10 @@ Here is an example:
   #:export (x y z ...))
 
 (define-module (my-module)
+  #:use-module (oop goops)
   #:use-module (math 2D-vectors)
   #:use-module (math 3D-vectors)
-  #:duplicates merge-generics)
+  #:duplicates (merge-generics))
 @end lisp
 
 The generic function @code{x} in @code{(my-module)} will now incorporate
@@ -1089,9 +1105,7 @@ Those class definitions define a hierarchy which is shown in
 @ref{fig:hier}.  In this figure, the class @code{<top>} is also shown;
 this class is the superclass of all Scheme objects.  In particular,
 @code{<top>} is the superclass of all standard Scheme
-types.@footnote{@code{<complex>}, which is the direct subclass of
-@code{<number>} and the direct superclass of @code{<real>}, has been
-omitted in this figure.}
+types.
 
 @float Figure,fig:hier
 @iftex
@@ -1240,10 +1254,10 @@ actual class C, if C1 comes before C2 in C's class precedence list.
 @node Introspection
 @section Introspection
 
-@dfn{Introspection}, also known as @dfn{reflection}, is the name given
-to the ability to obtain information dynamically about GOOPS metaobjects.
-It is perhaps best illustrated by considering an object oriented language
-that does not provide any introspection, namely C++.
+@dfn{Introspection}, or @dfn{reflection}, means being able to obtain
+information dynamically about GOOPS objects.  It is perhaps best
+illustrated by considering an object oriented language that does not
+provide any introspection, namely C++.
 
 Nothing in C++ allows a running program to obtain answers to the following
 types of question:
@@ -1270,62 +1284,56 @@ GOOPS equivalents --- to be obtained dynamically, at run time.
 
 @menu
 * Classes::
-* Slots::
 * Instances::
-* Built-in classes::
+* Slots::
 * Generic Functions::
-* Generic Function Methods::
+* Accessing Slots::
 @end menu
 
 @node Classes
 @subsection Classes
 
+A GOOPS class is itself an instance of the @code{<class>} class, or of a
+subclass of @code{<class>}.  The definition of the @code{<class>} class
+has slots that are used to describe the properties of a class, including
+the following.
+
 @deffn {primitive procedure} class-name class
-Return the name of class @var{class}.
-This is the value of the @var{class} metaobject's @code{name} slot.
+Return the name of class @var{class}.  This is the value of
+@var{class}'s @code{name} slot.
 @end deffn
 
 @deffn {primitive procedure} class-direct-supers class
-Return a list containing the direct superclasses of @var{class}.
-This is the value of the @var{class} metaobject's
-@code{direct-supers} slot.
+Return a list containing the direct superclasses of @var{class}.  This
+is the value of @var{class}'s @code{direct-supers} slot.
 @end deffn
 
 @deffn {primitive procedure} class-direct-slots class
 Return a list containing the slot definitions of the direct slots of
-@var{class}.
-This is the value of the @var{class} metaobject's @code{direct-slots}
+@var{class}.  This is the value of @var{class}'s @code{direct-slots}
 slot.
 @end deffn
 
 @deffn {primitive procedure} class-direct-subclasses class
-Return a list containing the direct subclasses of @var{class}.
-This is the value of the @var{class} metaobject's
-@code{direct-subclasses} slot.
+Return a list containing the direct subclasses of @var{class}.  This is
+the value of @var{class}'s @code{direct-subclasses} slot.
 @end deffn
 
 @deffn {primitive procedure} class-direct-methods class
 Return a list of all the generic function methods that use @var{class}
-as a formal parameter specializer.
-This is the value of the @var{class} metaobject's @code{direct-methods}
-slot.
+as a formal parameter specializer.  This is the value of @var{class}'s
+@code{direct-methods} slot.
 @end deffn
 
 @deffn {primitive procedure} class-precedence-list class
 Return the class precedence list for class @var{class} (@pxref{Class
-Precedence List}).
-This is the value of the @var{class} metaobject's @code{cpl} slot.
+Precedence List}).  This is the value of @var{class}'s @code{cpl} slot.
 @end deffn
 
 @deffn {primitive procedure} class-slots class
-Return a list containing the slot definitions for all @var{class}'s slots,
-including any slots that are inherited from superclasses.
-This is the value of the @var{class} metaobject's @code{slots} slot.
-@end deffn
-
-@deffn {primitive procedure} class-environment class
-Return the value of @var{class}'s @code{environment} slot.
-[ *fixme*  I don't know what this value is used for. ]
+Return a list containing the slot definitions for all @var{class}'s
+slots, including any slots that are inherited from superclasses.  This
+is the value of @var{class}'s @code{slots} slot.
 @end deffn
 
 @deffn procedure class-subclasses class
@@ -1337,6 +1345,48 @@ Return a list of all methods that use @var{class} or a subclass of
 @var{class} as one of its formal parameter specializers.
 @end deffn
 
+
+@node Instances
+@subsection Instances
+
+@deffn {primitive procedure} class-of value
+Return the GOOPS class of any Scheme @var{value}.
+@end deffn
+
+@deffn {primitive procedure} instance? object
+Return @code{#t} if @var{object} is any GOOPS instance, otherwise
+@code{#f}.
+@end deffn
+
+@deffn procedure is-a? object class
+Return @code{#t} if @var{object} is an instance of @var{class} or one of
+its subclasses.
+@end deffn
+
+You can use the @code{is-a?} predicate to ask whether any given value
+belongs to a given class, or @code{class-of} to discover the class of a
+given value.  Note that when GOOPS is loaded (by code using the
+@code{(oop goops)} module) built-in classes like @code{<string>},
+@code{<list>} and @code{<number>} are automatically set up,
+corresponding to all Guile Scheme types.
+
+@lisp
+(is-a? 2.3 <number>) @result{} #t
+(is-a? 2.3 <real>) @result{} #t
+(is-a? 2.3 <string>) @result{} #f
+(is-a? '("a" "b") <string>) @result{} #f
+(is-a? '("a" "b") <list>) @result{} #t
+(is-a? (car '("a" "b")) <string>) @result{} #t
+(is-a? <string> <class>) @result{} #t
+(is-a? <class> <string>) @result{} #f
+
+(class-of 2.3) @result{} #<<class> <real> 908c708>
+(class-of #(1 2 3)) @result{} #<<class> <vector> 908cd20>
+(class-of <string>) @result{} #<<class> <class> 8bd3e10>
+(class-of <class>) @result{} #<<class> <class> 8bd3e10>
+@end lisp
+
+
 @node Slots
 @subsection Slots
 
@@ -1418,84 +1468,41 @@ method, so, in general, the function returned by
 see @ref{Slot Options,, init-value}.
 @end deffn
 
-@node Instances
-@subsection Instances
-
-@deffn {primitive procedure} class-of value
-Return the GOOPS class of any Scheme @var{value}.
-@end deffn
-
-@deffn {primitive procedure} instance? object
-Return @code{#t} if @var{object} is any GOOPS instance, otherwise
-@code{#f}.
-@end deffn
-
-@deffn procedure is-a? object class
-Return @code{#t} if @var{object} is an instance of @var{class} or one of
-its subclasses.
-@end deffn
-
-Implementation notes: @code{is-a?} uses @code{class-of} and
-@code{class-precedence-list} to obtain the class precedence list for
-@var{object}.
-
-@node Built-in classes
-@subsection Built-in classes
-
-There are built-in classes like @code{<string>}, @code{<list>} and
-@code{<number>} corresponding to all the Guile Scheme types.  You can
-use the @code{is-a?} predicate to ask whether any given value belongs to
-a given class, or @code{class-of} to discover the class of a given
-value.
-
-@lisp
-(is-a? 2.3 <number>) @result{} #t
-(is-a? 2.3 <real>) @result{} #t
-(is-a? 2.3 <string>) @result{} #f
-(is-a? '("a" "b") <string>) @result{} #f
-(is-a? '("a" "b") <list>) @result{} #t
-(is-a? (car '("a" "b")) <string>) @result{} #t
-(is-a? <string> <class>) @result{} #t
-(is-a? <class> <string>) @result{} #f
-
-(class-of 2.3) @result{} #<<class> <real> 908c708>
-(class-of #(1 2 3)) @result{} #<<class> <vector> 908cd20>
-(class-of <string>) @result{} #<<class> <class> 8bd3e10>
-(class-of <class>) @result{} #<<class> <class> 8bd3e10>
-@end lisp
-
 
 @node Generic Functions
 @subsection Generic Functions
 
+A generic function is an instance of the @code{<generic>} class, or of a
+subclass of @code{<generic>}.  The definition of the @code{<generic>}
+class has slots that are used to describe the properties of a generic
+function.
+
 @deffn {primitive procedure} generic-function-name gf
 Return the name of generic function @var{gf}.
 @end deffn
 
 @deffn {primitive procedure} generic-function-methods gf
-Return a list of the methods of generic function @var{gf}.
-This is the value of the @var{gf} metaobject's @code{methods} slot.
+Return a list of the methods of generic function @var{gf}.  This is the
+value of @var{gf}'s @code{methods} slot.
 @end deffn
 
-@node Generic Function Methods
-@subsection Generic Function Methods
+Similarly, a method is an instance of the @code{<method>} class, or of a
+subclass of @code{<method>}; and the definition of the @code{<method>}
+class has slots that are used to describe the properties of a method.
 
 @deffn {primitive procedure} method-generic-function method
-Return the generic function that @var{method} belongs to.
-This is the value of the @var{method} metaobject's
-@code{generic-function} slot.
+Return the generic function that @var{method} belongs to.  This is the
+value of @var{method}'s @code{generic-function} slot.
 @end deffn
 
 @deffn {primitive procedure} method-specializers method
-Return a list of @var{method}'s formal parameter specializers .
-This is the value of the @var{method} metaobject's
-@code{specializers} slot.
+Return a list of @var{method}'s formal parameter specializers .  This is
+the value of @var{method}'s @code{specializers} slot.
 @end deffn
 
 @deffn {primitive procedure} method-procedure method
-Return the procedure that implements @var{method}.
-This is the value of the @var{method} metaobject's
-@code{procedure} slot.
+Return the procedure that implements @var{method}.  This is the value of
+@var{method}'s @code{procedure} slot.
 @end deffn
 
 @deffn generic method-source
@@ -1516,40 +1523,8 @@ Return an expression that prints to show the definition of method
 @end deffn
 
 
-@node Class Options
-@section Class Options
-
-@deffn {class option} #:metaclass metaclass
-The @code{#:metaclass} class option specifies the metaclass of the class
-being defined.  @var{metaclass} must be a class that inherits from
-@code{<class>}.  For the use of metaclasses, see @ref{Metaobjects and
-the Metaobject Protocol} and @ref{Terminology}.
-
-If the @code{#:metaclass} option is absent, GOOPS reuses or constructs a
-metaclass for the new class by calling @code{ensure-metaclass}
-(@pxref{Class Definition Internals,, ensure-metaclass}).
-@end deffn
-
-@deffn {class option} #:name name
-The @code{#:name} class option specifies the new class's name.  This
-name is used to identify the class whenever related objects - the class
-itself, its instances and its subclasses - are printed.
-
-If the @code{#:name} option is absent, GOOPS uses the first argument to
-@code{define-class} as the class name.
-@end deffn
-
 @node Accessing Slots
-@section Accessing Slots
-
-@menu
-* Instance Slots::
-* Class Slots::
-* Handling Slot Access Errors::
-@end menu
-
-@node Instance Slots
-@subsection Instance Slots
+@subsection Accessing Slots
 
 Any slot, regardless of its allocation, can be queried, referenced and
 set using the following four primitive procedures.
@@ -1564,28 +1539,28 @@ Return @code{#t} if the slot named @var{slot-name} in @var{obj} has a
 value, otherwise @code{#f}.
 
 @code{slot-bound?} calls the generic function @code{slot-missing} if
-@var{obj} does not have a slot called @var{slot-name} (@pxref{Handling
-Slot Access Errors, slot-missing}).
+@var{obj} does not have a slot called @var{slot-name} (@pxref{Accessing
+Slots, slot-missing}).
 @end deffn
 
 @deffn {primitive procedure} slot-ref obj slot-name
 Return the value of the slot named @var{slot-name} in @var{obj}.
 
 @code{slot-ref} calls the generic function @code{slot-missing} if
-@var{obj} does not have a slot called @var{slot-name} (@pxref{Handling
-Slot Access Errors, slot-missing}).
+@var{obj} does not have a slot called @var{slot-name} (@pxref{Accessing
+Slots, slot-missing}).
 
 @code{slot-ref} calls the generic function @code{slot-unbound} if the
-named slot in @var{obj} does not have a value (@pxref{Handling Slot
-Access Errors, slot-unbound}).
+named slot in @var{obj} does not have a value (@pxref{Accessing Slots,
+slot-unbound}).
 @end deffn
 
 @deffn {primitive procedure} slot-set! obj slot-name value
 Set the value of the slot named @var{slot-name} in @var{obj} to @var{value}.
 
 @code{slot-set!} calls the generic function @code{slot-missing} if
-@var{obj} does not have a slot called @var{slot-name} (@pxref{Handling
-Slot Access Errors, slot-missing}).
+@var{obj} does not have a slot called @var{slot-name} (@pxref{Accessing
+Slots, slot-missing}).
 @end deffn
 
 GOOPS stores information about slots in classes.  Internally,
@@ -1612,7 +1587,7 @@ arguments would call the generic function @code{slot-unbound}, otherwise
 
 @code{slot-bound-using-class?} calls the generic function
 @code{slot-missing} if @var{class} does not have a slot definition for a
-slot called @var{slot-name} (@pxref{Handling Slot Access Errors,
+slot called @var{slot-name} (@pxref{Accessing Slots,
 slot-missing}).
 @end deffn
 
@@ -1622,12 +1597,12 @@ Apply the ``getter'' closure for the slot named @var{slot-name} in
 
 @code{slot-ref-using-class} calls the generic function
 @code{slot-missing} if @var{class} does not have a slot definition for a
-slot called @var{slot-name} (@pxref{Handling Slot Access Errors,
+slot called @var{slot-name} (@pxref{Accessing Slots,
 slot-missing}).
 
 @code{slot-ref-using-class} calls the generic function
 @code{slot-unbound} if the application of the ``getter'' closure to
-@var{obj} returns an unbound value (@pxref{Handling Slot Access Errors,
+@var{obj} returns an unbound value (@pxref{Accessing Slots,
 slot-unbound}).
 @end deffn
 
@@ -1637,13 +1612,9 @@ Apply the ``setter'' closure for the slot named @var{slot-name} in
 
 @code{slot-set-using-class!} calls the generic function
 @code{slot-missing} if @var{class} does not have a slot definition for a
-slot called @var{slot-name} (@pxref{Handling Slot Access Errors,
-slot-missing}).
+slot called @var{slot-name} (@pxref{Accessing Slots, slot-missing}).
 @end deffn
 
-@node Class Slots
-@subsection Class Slots
-
 Slots whose allocation is per-class rather than per-instance can be
 referenced and set without needing to specify any particular instance.
 
@@ -1669,12 +1640,9 @@ allocation, @code{class-slot-ref} calls the @code{slot-missing} generic
 function with arguments @var{class} and @var{slot-name}.
 @end deffn
 
-@node Handling Slot Access Errors
-@subsection Handling Slot Access Errors
-
-GOOPS calls one of the following generic functions when a ``slot-ref''
-or ``slot-set!'' call specifies a non-existent slot name, or tries to
-reference a slot whose value is unbound.
+When a @code{slot-ref} or @code{slot-set!} call specifies a non-existent
+slot name, or tries to reference a slot whose value is unbound, GOOPS
+calls one of the following generic functions.
 
 @deffn generic slot-missing
 @deffnx method slot-missing (class <class>) slot-name
@@ -1700,361 +1668,148 @@ The default methods all call @code{goops-error} with an appropriate
 message.
 @end deffn
 
-@node Generic Functions and Accessors
-@section Generic Functions and Accessors
 
-A generic function is a collection of methods, with rules for
-determining which of the methods should be applied for any given
-invocation of the generic function.  GOOPS represents generic functions
-as metaobjects of the class @code{<generic>} (or one of its subclasses).
+@node GOOPS Error Handling
+@section Error Handling
 
-@menu
-* Determining Which Methods to Apply::
-@end menu
+The procedure @code{goops-error} is called to raise an appropriate error
+by the default methods of the following generic functions:
 
-@node Determining Which Methods to Apply
-@subsection Determining Which Methods to Apply
+@itemize @bullet
+@item
+@code{slot-missing} (@pxref{Accessing Slots,, slot-missing})
 
-[ *fixme*  Sorry - this is the area of GOOPS that I understand least of
-all, so I'm afraid I have to pass on this section.  Would some other
-kind person consider filling it in? ]
+@item
+@code{slot-unbound} (@pxref{Accessing Slots,, slot-unbound})
 
-@deffn generic apply-generic
-@deffnx method apply-generic (gf <generic>) args
-@end deffn
+@item
+@code{no-method} (@pxref{Handling Invocation Errors,, no-method})
 
-@deffn generic compute-applicable-methods
-@deffnx method compute-applicable-methods (gf <generic>) args
-@end deffn
+@item
+@code{no-applicable-method} (@pxref{Handling Invocation Errors,,
+no-applicable-method})
 
-@deffn generic sort-applicable-methods
-@deffnx method sort-applicable-methods (gf <generic>) methods args
-@end deffn
+@item
+@code{no-next-method} (@pxref{Handling Invocation Errors,,
+no-next-method})
+@end itemize
 
-@deffn generic method-more-specific?
-@deffnx method method-more-specific? (m1 <method>) (m2 <method>) args
-@end deffn
+If you customize these functions for particular classes or metaclasses,
+you may still want to use @code{goops-error} to signal any error
+conditions that you detect.
 
-@deffn generic apply-method
-@deffnx method apply-method (gf <generic>) methods build-next args
+@deffn procedure goops-error format-string arg @dots{}
+Raise an error with key @code{goops-error} and error message constructed
+from @var{format-string} and @var{arg} @enddots{}.  Error message
+formatting is as done by @code{scm-error}.
 @end deffn
 
-@deffn generic apply-methods
-@deffnx method apply-methods (gf <generic>) (l <list>) args
-@end deffn
 
-@node Redefining a Class
-@section Redefining a Class
+@node GOOPS Object Miscellany
+@section GOOPS Object Miscellany
 
-Suppose that a class @code{<my-class>} is defined using @code{define-class}
-(@pxref{Class Definition,, define-class}), with slots that have
-accessor functions, and that an application has created several instances
-of @code{<my-class>} using @code{make} (@pxref{Instance Creation,,
-make}).  What then happens if @code{<my-class>} is redefined by calling
-@code{define-class} again?
+Here we cover some points about GOOPS objects that aren't substantial
+enough to merit sections on their own.
 
-@menu
-* Default Class Redefinition Behaviour::
-* Customizing Class Redefinition::
-@end menu
+@subheading Object Equality
 
-@node Default Class Redefinition Behaviour
-@subsection Default Class Redefinition Behaviour
+When GOOPS is loaded, @code{eqv?}, @code{equal?} and @code{=} become
+generic functions, and you can define methods for them, specialized for
+your own classes, so as to control what the various kinds of equality
+mean for your classes.
 
-GOOPS' default answer to this question is as follows.
+For example, the @code{assoc} procedure, for looking up an entry in an
+alist, is specified as using @code{equal?} to determine when the car of
+an entry in the alist is the same as the key parameter that @code{assoc}
+is called with.  Hence, if you had defined a new class, and wanted to
+use instances of that class as the keys in an alist, you could define a
+method for @code{equal?}, for your class, to control @code{assoc}'s
+lookup precisely.
+
+@subheading Cloning Objects
+
+@deffn generic shallow-clone
+@deffnx method shallow-clone (self <object>)
+Return a ``shallow'' clone of @var{self}.  The default method makes a
+shallow clone by allocating a new instance and copying slot values from
+self to the new instance.  Each slot value is copied either as an
+immediate value or by reference.
+@end deffn
+
+@deffn generic deep-clone
+@deffnx method deep-clone (self <object>)
+Return a ``deep'' clone of @var{self}.  The default method makes a deep
+clone by allocating a new instance and copying or cloning slot values
+from self to the new instance.  If a slot value is an instance
+(satisfies @code{instance?}), it is cloned by calling @code{deep-clone}
+on that value.  Other slot values are copied either as immediate values
+or by reference.
+@end deffn
+
+@subheading Write and Display
+
+@deffn {primitive generic} write object port
+@deffnx {primitive generic} display object port
+When GOOPS is loaded, @code{write} and @code{display} become generic
+functions with special methods for printing
 
 @itemize @bullet
 @item
-All existing direct instances of @code{<my-class>} are converted to be
-instances of the new class.  This is achieved by preserving the values
-of slots that exist in both the old and new definitions, and
-initializing the values of new slots in the usual way (@pxref{Instance
-Creation,, make}).
+objects - instances of the class @code{<object>}
 
 @item
-All existing subclasses of @code{<my-class>} are redefined, as though
-the @code{define-class} expressions that defined them were re-evaluated
-following the redefinition of @code{<my-class>}, and the class
-redefinition process described here is applied recursively to the
-redefined subclasses.
+foreign objects - instances of the class @code{<foreign-object>}
 
 @item
-Once all of its instances and subclasses have been updated, the class
-metaobject previously bound to the variable @code{<my-class>} is no
-longer needed and so can be allowed to be garbage collected.
-@end itemize
-
-To keep things tidy, GOOPS also needs to do a little housekeeping on
-methods that are associated with the redefined class.
+classes - instances of the class @code{<class>}
 
-@itemize @bullet
 @item
-Slot accessor methods for slots in the old definition should be removed
-from their generic functions.  They will be replaced by accessor methods
-for the slots of the new class definition.
+generic functions - instances of the class @code{<generic>}
 
 @item
-Any generic function method that uses the old @code{<my-class>} metaobject
-as one of its formal parameter specializers must be updated to refer to
-the new @code{<my-class>} metaobject.  (Whenever a new generic function
-method is defined, @code{define-method} adds the method to a list stored
-in the class metaobject for each class used as a formal parameter
-specializer, so it is easy to identify all the methods that must be
-updated when a class is redefined.)
+methods - instances of the class @code{<method>}.
 @end itemize
 
-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.
+@code{write} and @code{display} print non-GOOPS values in the same way
+as the Guile primitive @code{write} and @code{display} functions.
+@end deffn
 
-Also bear in mind that, like most of GOOPS' default behaviour, it can
-be customized@dots{}
+In addition to the cases mentioned, you can of course define
+@code{write} and @code{display} methods for your own classes, to
+customize how instances of those classes are printed.
 
-@node Customizing Class Redefinition
-@subsection Customizing Class Redefinition
 
-When @code{define-class} notices that a class is being redefined,
-it constructs the new class metaobject as usual, and then invokes the
-@code{class-redefinition} generic function with the old and new classes
-as arguments.  Therefore, if the old or new classes have metaclasses
-other than the default @code{<class>}, class redefinition behaviour can
-be customized by defining a @code{class-redefinition} method that is
-specialized for the relevant metaclasses.
+@node The Metaobject Protocol
+@section The Metaobject Protocol
 
-@deffn generic class-redefinition
-Handle the class redefinition from @var{old-class} to @var{new-class},
-and return the new class metaobject that should be bound to the
-variable specified by @code{define-class}'s first argument.
-@end deffn
-
-@deffn method class-redefinition (old-class <class>) (new-class <class>)
-Implements GOOPS' default class redefinition behaviour, as described in
-@ref{Default Class Redefinition Behaviour}.  Returns the metaobject
-for the new class definition.
-@end deffn
-
-An alternative class redefinition strategy could be to leave all
-existing instances as instances of the old class, but accepting that the
-old class is now ``nameless'', since its name has been taken over by the
-new definition.  In this strategy, any existing subclasses could also
-be left as they are, on the understanding that they inherit from a nameless
-superclass.
-
-This strategy is easily implemented in GOOPS, by defining a new metaclass,
-that will be used as the metaclass for all classes to which the strategy
-should apply, and then defining a @code{class-redefinition} method that
-is specialized for this metaclass:
-
-@example
-(define-class <can-be-nameless> (<class>))
-
-(define-method (class-redefinition (old <can-be-nameless>)
-                                   (new <class>))
-  new)
-@end example
-
-When customization can be as easy as this, aren't you glad that GOOPS
-implements the far more difficult strategy as its default!
-
-Finally, note that, if @code{class-redefinition} itself is not customized,
-the default @code{class-redefinition} method invokes three further
-generic functions that could be individually customized:
-
-@itemize @bullet
-@item
-(remove-class-accessors! @var{old-class})
-
-@item
-(update-direct-method! @var{method} @var{old-class} @var{new-class})
-
-@item
-(update-direct-subclass! @var{subclass} @var{old-class} @var{new-class})
-@end itemize
-
-and the default methods for these generic functions invoke further
-generic functions, and so on@dots{}  The detailed protocol for all of these
-is described in @ref{MOP Specification}.
-
-@node Changing the Class of an Instance
-@section Changing the Class of an Instance
-
-You can change the class of an existing instance by invoking the
-generic function @code{change-class} with two arguments: the instance
-and the new class.
-
-@deffn generic change-class
-@end deffn
-
-The default method for @code{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 (@pxref{Classes,,
-slot-init-function}).
-
-@deffn {method} change-class (obj <object>) (new <class>)
-Modify instance @var{obj} to make it an instance of class @var{new}.
-
-The value of each of @var{obj}'s slots is preserved only if a similarly named
-slot exists in @var{new}; any other slot values are discarded.
-
-The slots in @var{new} that do not correspond to any of @var{obj}'s
-pre-existing slots are initialized according to @var{new}'s slot definitions'
-init functions.
-@end deffn
-
-Customized change of class behaviour can be implemented by defining
-@code{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 (@pxref{Redefining a Class}), and the default
-class redefinition behaviour is not overridden, GOOPS (eventually)
-invokes the @code{change-class} generic function for each existing
-instance of the redefined class.
-
-@node GOOPS Error Handling
-@section Error Handling
-
-The procedure @code{goops-error} is called to raise an appropriate error
-by the default methods of the following generic functions:
-
-@itemize @bullet
-@item
-@code{slot-missing} (@pxref{Handling Slot Access Errors,, slot-missing})
-
-@item
-@code{slot-unbound} (@pxref{Handling Slot Access Errors,, slot-unbound})
-
-@item
-@code{no-method} (@pxref{Handling Invocation Errors,, no-method})
-
-@item
-@code{no-applicable-method} (@pxref{Handling Invocation Errors,,
-no-applicable-method})
-
-@item
-@code{no-next-method} (@pxref{Handling Invocation Errors,,
-no-next-method})
-@end itemize
-
-If you customize these functions for particular classes or metaclasses,
-you may still want to use @code{goops-error} to signal any error
-conditions that you detect.
-
-@deffn procedure goops-error format-string . args
-Raise an error with key @code{goops-error} and error message constructed
-from @var{format-string} and @var{args}.  Error message formatting is
-as done by @code{scm-error}.
-@end deffn
-
-@node Object Comparisons
-@section Object Comparisons
-
-@deffn generic eqv?
-@deffnx method eqv? ((x <top>) (y <top>))
-@deffnx generic equal?
-@deffnx method equal? ((x <top>) (y <top>))
-@deffnx generic =
-@deffnx method = ((x <number>) (y <number>))
-Generic functions and default (unspecialized) methods for comparing two
-GOOPS objects.
-
-The default method for @code{eqv?} returns @code{#t} for all values
-that are equal in the sense defined by R5RS and the Guile reference
-manual, otherwise @code{#f}.  The default method for @code{equal?}
-returns @code{#t} or @code{#f} in the sense defined by R5RS and the
-Guile reference manual.  If no such comparison is defined,
-@code{equal?} returns the result of a call to @code{eqv?}.  The
-default method for = returns @code{#t} if @var{x} and @var{y} are
-numerically equal, otherwise @code{#f}.
-
-Application class authors may wish to define specialized methods for
-@code{eqv?}, @code{equal?} and @code{=} that compare instances of the
-same class for equality in whatever sense is useful to the
-application.  Such methods will only be called if the arguments have
-the same class and the result of the comparison isn't defined by R5RS
-and the Guile reference manual.
-@end deffn
-
-@node Cloning Objects
-@section Cloning Objects
-
-@deffn generic shallow-clone
-@deffnx method shallow-clone (self <object>)
-Return a ``shallow'' clone of @var{self}.  The default method makes a
-shallow clone by allocating a new instance and copying slot values from
-self to the new instance.  Each slot value is copied either as an
-immediate value or by reference.
-@end deffn
-
-@deffn generic deep-clone
-@deffnx method deep-clone (self <object>)
-Return a ``deep'' clone of @var{self}.  The default method makes a deep
-clone by allocating a new instance and copying or cloning slot values
-from self to the new instance.  If a slot value is an instance
-(satisfies @code{instance?}), it is cloned by calling @code{deep-clone}
-on that value.  Other slot values are copied either as immediate values
-or by reference.
-@end deffn
-
-@node Write and Display
-@section Write and Display
-
-@deffn {primitive generic} write object port
-@deffnx {primitive generic} display object port
-When GOOPS is loaded, @code{write} and @code{display} become generic
-functions with special methods for printing
-
-@itemize @bullet
-@item
-objects - instances of the class @code{<object>}
-
-@item
-foreign objects - instances of the class @code{<foreign-object>}
-
-@item
-classes - instances of the class @code{<class>}
-
-@item
-generic functions - instances of the class @code{<generic>}
-
-@item
-methods - instances of the class @code{<method>}.
-@end itemize
-
-@code{write} and @code{display} print non-GOOPS values in the same way
-as the Guile primitive @code{write} and @code{display} functions.
-@end deffn
-
-@node The Metaobject Protocol
-@section The Metaobject Protocol
-
-GOOPS is based on a ``metaobject protocol'' (aka ``MOP'') derived from
-the ones used in CLOS (the Common Lisp Object System), tiny-clos (a
-small Scheme implementation of a subset of CLOS functionality) and
-STKlos.
-
-GOOPS can be used by application authors at a basic level without any
-need to understand what the MOP is and how it works.  On the other hand,
-the MOP underlies even very simple customizations --- such as defining
-an @code{initialize} method to customize the initialization of instances
-of an application-defined class --- and an understanding of the MOP
-makes it much easier to explain such customizations in a precise way.
-And in the long run, understanding the MOP is the key both to
-understanding GOOPS at a deeper level and to taking full advantage of
-GOOPS' power, by customizing the behaviour of GOOPS itself.
+At this point, we've said about as much as can be said about GOOPS
+without having to confront the idea of the metaobject protocol.  There
+are a couple more topics that could be discussed in isolation first ---
+class redefinition, and changing the class of existing instances --- but
+in practice developers using them will be advanced enough to want to
+understand the metaobject protocol too, and will probably be using the
+protocol to customize exactly what happens during these events.
+
+So let's plunge in.  GOOPS is based on a ``metaobject protocol'' (aka
+``MOP'') derived from the ones used in CLOS (the Common Lisp Object
+System), tiny-clos (a small Scheme implementation of a subset of CLOS
+functionality) and STKlos.
+
+The MOP underlies many possible GOOPS customizations --- such as
+defining an @code{initialize} method to customize the initialization of
+instances of an application-defined class --- and an understanding of
+the MOP makes it much easier to explain such customizations in a precise
+way.  And at a deeper level, understanding the MOP is a key part of
+understanding GOOPS, and of taking full advantage of GOOPS' power, by
+customizing the behaviour of GOOPS itself.
 
 @menu
 * Metaobjects and the Metaobject Protocol::
-* Terminology::
+* Metaclasses::
 * MOP Specification::
-* Class Definition Internals::
+* Instance Creation Protocol::
+* Class Definition Protocol::
 * Customizing Class Definition::
-* Customizing Instance Creation::
-* Class Redefinition::
 * Method Definition::
 * Method Definition Internals::
 * Generic Function Internals::
@@ -2088,7 +1843,7 @@ as regards accessibility and protection from garbage collection.
 Instances are of course objects in the usual sense, and there is no
 benefit from thinking of them as metaobjects.)
 
-The ``metaobject protocol'' (aka ``MOP'') is the specification of the
+The ``metaobject protocol'' (or ``MOP'') is the specification of the
 generic functions which determine the behaviour of these metaobjects and
 the circumstances in which these generic functions are invoked.
 
@@ -2114,7 +1869,7 @@ superclasses, slot definitions and class options that were specified in
 the @code{define-class} form.
 
 @item
-@code{make} allocates memory for the new instance, and then invokes the
+@code{make} allocates memory for the new instance, and invokes the
 @code{initialize} generic function to initialize the new instance's
 slots.
 
@@ -2125,8 +1880,8 @@ performs the slot calculation.
 @end itemize
 
 In other words, rather than being hardcoded in @code{define-class}, the
-behaviour of class definition is encapsulated by generic function
-methods that are specialized for the class @code{<class>}.
+default behaviour of class definition is encapsulated by generic
+function methods that are specialized for the class @code{<class>}.
 
 It is possible to create a new class that inherits from @code{<class>},
 which is called a ``metaclass'', and to write a new @code{initialize}
@@ -2157,19 +1912,8 @@ Each following section covers a particular area of GOOPS functionality,
 and describes the generic functions that are relevant for customization
 of that area.
 
-@node Terminology
-@subsection Terminology
-
-It is assumed that the reader is already familiar with standard object
-orientation concepts such as classes, objects/instances,
-inheritance/subclassing, generic functions and methods, encapsulation
-and polymorphism.
-
-This section explains some of the less well known concepts and
-terminology that GOOPS uses, which are assumed by the following sections
-of the reference manual.
-
-@subsubheading Metaclass
+@node Metaclasses
+@subsection Metaclasses
 
 A @dfn{metaclass} is the class of an object which represents a GOOPS
 class.  Put more succinctly, a metaclass is a class's class.
@@ -2185,30 +1929,29 @@ at what happens when a new class is created using @code{define-class}:
 (define-class <my-class> (<object>) . slots)
 @end example
 
-GOOPS actually expands the @code{define-class} form to something like
-this
+@noindent
+Guile expands this to something like:
 
 @example
 (define <my-class> (class (<object>) . slots))
 @end example
 
-and thence to
+@noindent
+which in turn expands to:
 
 @example
 (define <my-class>
-  (make <class> #:supers (list <object>) #:slots slots))
+  (make <class> #:dsupers (list <object>) #:slots slots))
 @end example
 
-In other words, the value of @code{<my-class>} is in fact an instance of
-the class @code{<class>} with slot values specifying the superclasses
-and slot definitions for the class @code{<my-class>}.  (@code{#:supers}
-and @code{#:slots} are initialization keywords for the @code{dsupers}
-and @code{dslots} slots of the @code{<class>} class.)
+As this expansion makes clear, the resulting value of @code{<my-class>}
+is an instance of the class @code{<class>} with slot values specifying
+the superclasses and slot definitions for the class @code{<my-class>}.
+(@code{#:dsupers} and @code{#:slots} are initialization keywords for the
+@code{dsupers} and @code{dslots} slots of the @code{<class>} class.)
 
-In order to take advantage of the full power of the GOOPS metaobject
-protocol (@pxref{MOP Specification}), it is sometimes desirable to
-create a new class with a metaclass other than the default
-@code{<class>}.  This is done by writing:
+Now suppose that you want to define a new class with a metaclass other
+than the default @code{<class>}.  This is done by writing:
 
 @example
 (define-class <my-class2> (<object>)
@@ -2216,11 +1959,12 @@ create a new class with a metaclass other than the default
    #:metaclass <my-metaclass>)
 @end example
 
-GOOPS expands this to something like:
+@noindent
+and Guile expands @emph{this} to something like:
 
 @example
 (define <my-class2>
-  (make <my-metaclass> #:supers (list <object>) #:slots slots))
+  (make <my-metaclass> #:dsupers (list <object>) #:slots slots))
 @end example
 
 In this case, the value of @code{<my-class2>} is an instance of the more
@@ -2252,92 +1996,13 @@ relationships between @code{my-object}, @code{<my-class2>},
 @item
 The class of @code{my-object} is @code{<my-class2>}.
 
-@item
-The metaclass of @code{my-object} is @code{<my-metaclass>}.
-
 @item
 The class of @code{<my-class2>} is @code{<my-metaclass>}.
 
-@item
-The metaclass of @code{<my-class2>} is @code{<class>}.
-
 @item
 The class of @code{<my-metaclass>} is @code{<class>}.
-
-@item
-The metaclass of @code{<my-metaclass>} is @code{<class>}.
-
-@item
-@code{<my-class2>} is not a metaclass, since it is does not inherit from
-@code{<class>}.
-
-@item
-@code{<my-metaclass>} is a metaclass, since it inherits from
-@code{<class>}.
 @end itemize
 
-@subsubheading Class Precedence List
-
-The @dfn{class precedence list} of a class is the list of all direct and
-indirect superclasses of that class, including the class itself.
-
-In the absence of multiple inheritance, the class precedence list is
-ordered straightforwardly, beginning with the class itself and ending
-with @code{<top>}.
-
-For example, given this inheritance hierarchy:
-
-@example
-(define-class <invertebrate> (<object>) @dots{})
-(define-class <echinoderm> (<invertebrate>) @dots{})
-(define-class <starfish> (<echinoderm>) @dots{})
-@end example
-
-the class precedence list of <starfish> would be
-
-@example
-(<starfish> <echinoderm> <invertebrate> <object> <top>)
-@end example
-
-With multiple inheritance, the algorithm is a little more complicated.
-A full description is provided by the GOOPS Tutorial: see @ref{Class
-Precedence List}.
-
-``Class precedence list'' is often abbreviated, in documentation and
-Scheme variable names, to @dfn{cpl}.
-
-@subsubheading Accessor
-
-An @dfn{accessor} is a generic function with both reference and setter
-methods.
-
-@example
-(define-accessor perimeter)
-@end example
-
-Reference methods for an accessor are defined in the same way as generic
-function methods.
-
-@example
-(define-method (perimeter (s <square>))
-  (* 4 (side-length s)))
-@end example
-
-Setter methods for an accessor are defined by specifying ``(setter
-<accessor-name>)'' as the first parameter of the @code{define-method}
-call.
-
-@example
-(define-method ((setter perimeter) (s <square>) (n <number>))
-  (set! (side-length s) (/ n 4)))
-@end example
-
-Once an appropriate setter method has been defined in this way, it can
-be invoked using the generalized @code{set!} syntax, as in:
-
-@example
-(set! (perimeter s1) 18.3)
-@end example
 
 @node MOP Specification
 @subsection MOP Specification
@@ -2347,22 +2012,17 @@ customizable generic function invocations that can be made by the standard
 GOOPS syntax, procedures and methods, and to explain the protocol for
 customizing such invocations.
 
-A generic function invocation is customizable if the types of the arguments
-to which it is applied are not all determined by the lexical context in
-which the invocation appears.  For example,
-
-@itemize @bullet
-@item
-the @code{(initialize @var{instance} @var{initargs})} invocation in the
-default @code{make-instance} method is customizable, because the type of the
-@code{@var{instance}} argument is determined by the class that was passed to
-@code{make-instance}.
+A generic function invocation is customizable if the types of the
+arguments to which it is applied are not completely determined by the
+lexical context in which the invocation appears.  For example, the
+@code{(initialize @var{instance} @var{initargs})} invocation in the
+default @code{make-instance} method is customizable, because the type of
+the @code{@var{instance}} argument is determined by the class that was
+passed to @code{make-instance}.
 
-@item
-the @code{(make <generic> #:name ',name)} invocation in @code{define-generic}
-is not customizable, because all of its arguments have lexically determined
-types.
-@end itemize
+(Whereas --- to give a counter-example --- the @code{(make <generic>
+#:name ',name)} invocation in @code{define-generic} is not customizable,
+because all of its arguments have lexically determined types.)
 
 When using this rule to decide whether a given generic function invocation
 is customizable, we ignore arguments that are expected to be handled in
@@ -2383,140 +2043,174 @@ effects
 what the caller expects to get as the applied method's return value.
 @end itemize
 
-@node Class Definition Internals
-@subsection Class Definition Internals
 
-@code{define-class} (syntax)
+@node Instance Creation Protocol
+@subsection Instance Creation Protocol
 
-@itemize @bullet
-@item
-@code{class} (syntax)
+@code{make <class> . @var{initargs}} (method)
 
 @itemize @bullet
 @item
-@code{make-class} (procedure)
+@code{allocate-instance @var{class} @var{initargs}} (generic)
+
+The applied @code{allocate-instance} method should allocate storage for
+a new instance of class @var{class} and return the uninitialized instance.
 
-@itemize @bullet
 @item
-@code{make @var{metaclass} @dots{}} (generic)
+@code{initialize @var{instance} @var{initargs}} (generic)
 
-@var{metaclass} is the metaclass of the class being defined, either
-taken from the @code{#:metaclass} class option or computed by
-@code{ensure-metaclass}.  The applied method must create and return the
-fully initialized class metaobject for the new class definition.
+@var{instance} is the uninitialized instance returned by
+@code{allocate-instance}.  The applied method should initialize the new
+instance in whatever sense is appropriate for its class.  The method's
+return value is ignored.
 @end itemize
 
-@end itemize
+@code{make} itself is a generic function.  Hence the @code{make}
+invocation itself can be customized in the case where the new instance's
+metaclass is more specialized than the default @code{<class>}, by
+defining a @code{make} method that is specialized to that metaclass.
+
+Normally, however, the method for classes with metaclass @code{<class>}
+will be applied.  This method calls two generic functions:
 
+@itemize @bullet
 @item
-@code{class-redefinition @var{old-class} @var{new-class}} (generic)
+(allocate-instance @var{class} . @var{initargs})
 
-@code{define-class} calls @code{class-redefinition} if the variable
-specified by its first argument already held a GOOPS class definition.
-@var{old-class} and @var{new-class} are the old and new class metaobjects.
-The applied method should perform whatever is necessary to handle the
-redefinition, and should return the class metaobject that is to be bound
-to @code{define-class}'s variable.  The default class redefinition
-protocol is described in @ref{Class Redefinition}.
+@item
+(initialize @var{instance} . @var{initargs})
 @end itemize
 
-The @code{(make @var{metaclass} @dots{})} invocation above will create
-an class metaobject with metaclass @var{metaclass}.  By default, this
-metaobject will be initialized by the @code{initialize} method that is
-specialized for instances of type @code{<class>}.
+@code{allocate-instance} allocates storage for and returns the new
+instance, uninitialized.  You might customize @code{allocate-instance},
+for example, if you wanted to provide a GOOPS wrapper around some other
+object programming system.
+
+To do this, you would create a specialized metaclass, which would act as
+the metaclass for all classes and instances from the other system.  Then
+define an @code{allocate-instance} method, specialized to that
+metaclass, which calls a Guile primitive C function (or FFI code), which
+in turn allocates the new instance using the interface of the other
+object system.
+
+In this case, for a complete system, you would also need to customize a
+number of other generic functions like @code{make} and
+@code{initialize}, so that GOOPS knows how to make classes from the
+other system, access instance slots, and so on.
 
-@code{initialize <class> @var{initargs}} (method)
+@code{initialize} initializes the instance that is returned by
+@code{allocate-instance}.  The standard GOOPS methods perform
+initializations appropriate to the instance class.
 
 @itemize @bullet
 @item
-@code{compute-cpl @var{class}} (generic)
+At the least specialized level, the method for instances of type
+@code{<object>} performs internal GOOPS instance initialization, and
+initializes the instance's slots according to the slot definitions and
+any slot initialization keywords that appear in @var{initargs}.
 
-The applied method should compute and return the class precedence list
-for @var{class} as a list of class metaobjects.  When @code{compute-cpl}
-is called, the following @var{class} metaobject slots have all been
-initialized: @code{name}, @code{direct-supers}, @code{direct-slots},
-@code{direct-subclasses} (empty), @code{direct-methods}.  The value
-returned by @code{compute-cpl} will be stored in the @code{cpl} slot.
+@item
+The method for instances of type @code{<class>} calls
+@code{(next-method)}, then performs the class initializations described
+in @ref{Class Definition Protocol}.
 
 @item
-@code{compute-slots @var{class}} (generic)
+and so on for generic functions, methods, operator classes @dots{}
+@end itemize
 
-The applied method should compute and return the slots (union of direct
-and inherited) for @var{class} as a list of slot definitions.  When
-@code{compute-slots} is called, all the @var{class} metaobject slots
-mentioned for @code{compute-cpl} have been initialized, plus the
-following: @code{cpl}, @code{redefined} (@code{#f}), @code{environment}.
-The value returned by @code{compute-slots} will be stored in the
-@code{slots} slot.
+Similarly, you can customize the initialization of instances of any
+application-defined class by defining an @code{initialize} method
+specialized to that class.
 
+Imagine a class whose instances' slots need to be initialized at
+instance creation time by querying a database.  Although it might be
+possible to achieve this a combination of @code{#:init-thunk} keywords
+and closures in the slot definitions, it may be neater to write an
+@code{initialize} method for the class that queries the database once
+and initializes all the dependent slot values according to the results.
+
+
+@node Class Definition Protocol
+@subsection Class Definition Protocol
+
+Here is a summary diagram of the syntax, procedures and generic
+functions that may be involved in class definition.
+
+@noindent
+@code{define-class} (syntax)
+
+@itemize @bullet
 @item
-@code{compute-get-n-set @var{class} @var{slot-def}} (generic)
+@code{class} (syntax)
 
-@code{initialize} calls @code{compute-get-n-set} for each slot computed
-by @code{compute-slots}.  The applied method should compute and return a
-pair of closures that, respectively, get and set the value of the specified
-slot.  The get closure should have arity 1 and expect a single argument
-that is the instance whose slot value is to be retrieved.  The set closure
-should have arity 2 and expect two arguments, where the first argument is
-the instance whose slot value is to be set and the second argument is the
-new value for that slot.  The closures should be returned in a two element
-list: @code{(list @var{get} @var{set})}.
+@itemize @bullet
+@item
+@code{make-class} (procedure)
 
-The closures returned by @code{compute-get-n-set} are stored as part of
-the value of the @var{class} metaobject's @code{getters-n-setters} slot.
-Specifically, the value of this slot is a list with the same number of
-elements as there are slots in the class, and each element looks either like
+@itemize @bullet
+@item
+@code{ensure-metaclass} (procedure)
 
-@example
-@code{(@var{slot-name-symbol} @var{init-function} . @var{index})}
-@end example
+@item
+@code{make @var{metaclass} @dots{}} (generic)
 
-or like
+@itemize @bullet
+@item
+@code{allocate-instance} (generic)
 
-@example
-@code{(@var{slot-name-symbol} @var{init-function} @var{get} @var{set})}
-@end example
+@item
+@code{initialize} (generic)
 
-Where the get and set closures are replaced by @var{index}, the slot is
-an instance slot and @var{index} is the slot's index in the underlying
-structure: GOOPS knows how to get and set the value of such slots and so
-does not need specially constructed get and set closures.  Otherwise,
-@var{get} and @var{set} are the closures returned by @code{compute-get-n-set}.
+@itemize @bullet
+@item
+@code{compute-cpl} (generic)
 
-The structure of the @code{getters-n-setters} slot value is important when
-understanding the next customizable generic functions that @code{initialize}
-calls@dots{}
+@itemize @bullet
+@item
+@code{compute-std-cpl} (procedure)
+@end itemize
 
 @item
-@code{compute-getter-method @var{class} @var{gns}} (generic)
+@code{compute-slots} (generic)
 
-@code{initialize} calls @code{compute-getter-method} for each of the class's
-slots (as determined by @code{compute-slots}) that includes a
-@code{#:getter} or @code{#:accessor} slot option.  @var{gns} is the
-element of the @var{class} metaobject's @code{getters-n-setters} slot that
-specifies how the slot in question is referenced and set, as described
-above under @code{compute-get-n-set}.  The applied method should create
-and return a method that is specialized for instances of type @var{class}
-and uses the get closure to retrieve the slot's value.  [ *fixme  Need
-to insert something here about checking that the value is not unbound. ]
-@code{initialize} uses @code{add-method!} to add the returned method to
-the generic function named by the slot definition's @code{#:getter} or
-@code{#:accessor} option.
+@item
+@code{compute-get-n-set} (generic)
 
 @item
-@code{compute-setter-method @var{class} @var{gns}} (generic)
+@code{compute-getter-method} (generic)
 
-@code{compute-setter-method} is invoked with the same arguments as
-@code{compute-getter-method}, for each of the class's slots that includes
-a @code{#:setter} or @code{#:accessor} slot option.  The applied method
-should create and return a method that is specialized for instances of
-type @var{class} and uses the set closure to set the slot's value.
-@code{initialize} then uses @code{add-method!} to add the returned method
-to the generic function named by the slot definition's @code{#:setter}
-or @code{#:accessor} option.
+@item
+@code{compute-setter-method} (generic)
+@end itemize
+@end itemize
+@end itemize
 @end itemize
 
-@code{define-class} expands to an expression which
+@item
+@code{class-redefinition} (generic)
+
+@itemize @bullet
+@item
+@code{remove-class-accessors} (generic)
+
+@item
+@code{update-direct-method!} (generic)
+
+@item
+@code{update-direct-subclass!} (generic)
+@end itemize
+@end itemize
+
+Wherever a step above is marked as ``generic'', it can be customized,
+and the detail shown below it is only ``correct'' insofar as it
+describes what the default method of that generic function does.  For
+example, if you write an @code{initialize} method, for some metaclass,
+that does not call @code{next-method} and does not call
+@code{compute-cpl}, then @code{compute-cpl} will not be called when a
+class is defined with that metaclass. 
+
+A @code{(define-class ...)} form (@pxref{Class Definition}) expands to
+an expression which
 
 @itemize @bullet
 @item
@@ -2526,8 +2220,7 @@ checks that it is being evaluated only at top level
 defines any accessors that are implied by the @var{slot-definition}s
 
 @item
-uses @code{class} to create the new class (@pxref{Class Definition
-Internals,, class})
+uses @code{class} to create the new class
 
 @item
 checks for a previous class definition for @var{name} and, if found,
@@ -2535,11 +2228,12 @@ handles the redefinition by invoking @code{class-redefinition}
 (@pxref{Redefining a Class}).
 @end itemize
 
-@deffn syntax class name (super @dots{}) slot-definition @dots{} . options
+@deffn syntax class name (super @dots{}) @
+              slot-definition @dots{} class-option @dots{}
 Return a newly created class that inherits from @var{super}s, with
-direct slots defined by @var{slot-definition}s and class options
-@var{options}.  For the format of @var{slot-definition}s and
-@var{options}, see @ref{Class Definition,, define-class}.
+direct slots defined by @var{slot-definition}s and @var{class-option}s.
+For the format of @var{slot-definition}s and @var{class-option}s, see
+@ref{Class Definition,, define-class}.
 @end deffn
 
 @noindent @code{class} expands to an expression which
@@ -2557,13 +2251,12 @@ calls @code{make-class} to create the class with the processed and
 evaluated parameters.
 @end itemize
 
-@deffn procedure make-class supers slots . options
+@deffn procedure make-class supers slots class-option @dots{}
 Return a newly created class that inherits from @var{supers}, with
-direct slots defined by @var{slots} and class options @var{options}.
-For the format of @var{slots} and @var{options}, see @ref{Class
+direct slots defined by @var{slots} and @var{class-option}s.  For the
+format of @var{slots} and @var{class-option}s, see @ref{Class
 Definition,, define-class}, except note that for @code{make-class},
-@var{slots} and @var{options} are separate list parameters: @var{slots}
-here is a list of slot definitions.
+@var{slots} is a separate list of slot definitions.
 @end deffn
 
 @noindent @code{make-class}
@@ -2578,8 +2271,7 @@ class precedence list
 defaults the @code{#:environment}, @code{#:name} and @code{#:metaclass}
 options, if they are not specified by @var{options}, to the current
 top-level environment, the unbound value, and @code{(ensure-metaclass
-@var{supers})} respectively (@pxref{Class Definition Internals,,
-ensure-metaclass})
+@var{supers})} respectively
 
 @item
 checks for duplicate classes in @var{supers} and duplicate slot names in
@@ -2615,55 +2307,114 @@ has to be created once.
 The @code{env} parameter is ignored.
 @end deffn
 
-@deffn procedure ensure-metaclass-with-supers meta-supers
-@code{ensure-metaclass-with-supers} is an internal procedure used by
-@code{ensure-metaclass} (@pxref{Class Definition Internals,,
-ensure-metaclass}).  It returns a metaclass that is the union by
-inheritance of the metaclasses in @var{meta-supers}.
+@deffn generic make metaclass initarg @dots{}
+@var{metaclass} is the metaclass of the class being defined, either
+taken from the @code{#:metaclass} class option or computed by
+@code{ensure-metaclass}.  The applied method must create and return the
+fully initialized class metaobject for the new class definition.
 @end deffn
 
-The internals of @code{make}, which is ultimately used to create the new
-class object, are described in @ref{Customizing Instance Creation},
-which covers the creation and initialization of instances in general.
-
-@node Customizing Class Definition
-@subsection Customizing Class Definition
+The @code{(make @var{metaclass} @var{initarg} @dots{})} invocation is a
+particular case of the instance creation protocol covered in the
+previous section.  It will create an class metaobject with metaclass
+@var{metaclass}.  By default, this metaobject will be initialized by the
+@code{initialize} method that is specialized for instances of type
+@code{<class>}.
 
-During the initialization of a new class, GOOPS calls a number of generic
-functions with the newly allocated class instance as the first
-argument.  Specifically, GOOPS calls the generic function
+The @code{initialize} method for classes (signature @code{(initialize
+<class> initargs)}) calls the following generic functions.
 
 @itemize @bullet
 @item
-(initialize @var{class} @dots{})
-@end itemize
+@code{compute-cpl @var{class}} (generic)
 
-where @var{class} is the newly allocated class instance, and the default
-@code{initialize} method for arguments of type @code{<class>} calls the
-generic functions
+The applied method should compute and return the class precedence list
+for @var{class} as a list of class metaobjects.  When @code{compute-cpl}
+is called, the following @var{class} metaobject slots have all been
+initialized: @code{name}, @code{direct-supers}, @code{direct-slots},
+@code{direct-subclasses} (empty), @code{direct-methods}.  The value
+returned by @code{compute-cpl} will be stored in the @code{cpl} slot.
 
-@itemize @bullet
 @item
-(compute-cpl @var{class})
+@code{compute-slots @var{class}} (generic)
 
-@item
-(compute-slots @var{class})
+The applied method should compute and return the slots (union of direct
+and inherited) for @var{class} as a list of slot definitions.  When
+@code{compute-slots} is called, all the @var{class} metaobject slots
+mentioned for @code{compute-cpl} have been initialized, plus the
+following: @code{cpl}, @code{redefined} (@code{#f}), @code{environment}.
+The value returned by @code{compute-slots} will be stored in the
+@code{slots} slot.
 
 @item
-(compute-get-n-set @var{class} @var{slot-def}), for each of the slot
-definitions returned by @code{compute-slots}
+@code{compute-get-n-set @var{class} @var{slot-def}} (generic)
+
+@code{initialize} calls @code{compute-get-n-set} for each slot computed
+by @code{compute-slots}.  The applied method should compute and return a
+pair of closures that, respectively, get and set the value of the specified
+slot.  The get closure should have arity 1 and expect a single argument
+that is the instance whose slot value is to be retrieved.  The set closure
+should have arity 2 and expect two arguments, where the first argument is
+the instance whose slot value is to be set and the second argument is the
+new value for that slot.  The closures should be returned in a two element
+list: @code{(list @var{get} @var{set})}.
+
+The closures returned by @code{compute-get-n-set} are stored as part of
+the value of the @var{class} metaobject's @code{getters-n-setters} slot.
+Specifically, the value of this slot is a list with the same number of
+elements as there are slots in the class, and each element looks either like
+
+@example
+@code{(@var{slot-name-symbol} @var{init-function} . @var{index})}
+@end example
+
+or like
+
+@example
+@code{(@var{slot-name-symbol} @var{init-function} @var{get} @var{set})}
+@end example
+
+Where the get and set closures are replaced by @var{index}, the slot is
+an instance slot and @var{index} is the slot's index in the underlying
+structure: GOOPS knows how to get and set the value of such slots and so
+does not need specially constructed get and set closures.  Otherwise,
+@var{get} and @var{set} are the closures returned by @code{compute-get-n-set}.
+
+The structure of the @code{getters-n-setters} slot value is important when
+understanding the next customizable generic functions that @code{initialize}
+calls@dots{}
 
 @item
-(compute-getter-method @var{class} @var{slot-def}), for each of the
-slot definitions returned by @code{compute-slots} that includes a
-@code{#:getter} or @code{#:accessor} slot option
+@code{compute-getter-method @var{class} @var{gns}} (generic)
+
+@code{initialize} calls @code{compute-getter-method} for each of the
+class's slots (as determined by @code{compute-slots}) that includes a
+@code{#:getter} or @code{#:accessor} slot option.  @var{gns} is the
+element of the @var{class} metaobject's @code{getters-n-setters} slot
+that specifies how the slot in question is referenced and set, as
+described above under @code{compute-get-n-set}.  The applied method
+should create and return a method that is specialized for instances of
+type @var{class} and uses the get closure to retrieve the slot's value.
+@code{initialize} uses @code{add-method!} to add the returned method to
+the generic function named by the slot definition's @code{#:getter} or
+@code{#:accessor} option.
 
 @item
-(compute-setter-method @var{class} @var{slot-def}), for each of the
-slot definitions returned by @code{compute-slots} that includes a
-@code{#:setter} or @code{#:accessor} slot option.
+@code{compute-setter-method @var{class} @var{gns}} (generic)
+
+@code{compute-setter-method} is invoked with the same arguments as
+@code{compute-getter-method}, for each of the class's slots that includes
+a @code{#:setter} or @code{#:accessor} slot option.  The applied method
+should create and return a method that is specialized for instances of
+type @var{class} and uses the set closure to set the slot's value.
+@code{initialize} then uses @code{add-method!} to add the returned method
+to the generic function named by the slot definition's @code{#:setter}
+or @code{#:accessor} option.
 @end itemize
 
+@node Customizing Class Definition
+@subsection Customizing Class Definition
+
 If the metaclass of the new class is something more specialized than the
 default @code{<class>}, then the type of @var{class} in the calls above
 is more specialized than @code{<class>}, and hence it becomes possible
@@ -2681,8 +2432,7 @@ customized in order to modify the CPL ordering algorithm for all classes
 with a special metaclass.
 
 The default CPL algorithm is encapsulated by the @code{compute-std-cpl}
-procedure, which is in turn called by the default @code{compute-cpl}
-method.
+procedure, which is called by the default @code{compute-cpl} method.
 
 @deffn procedure compute-std-cpl class
 Compute and return the class precedence list for @var{class} according
@@ -2751,7 +2501,7 @@ allocation to do this.
 @end example
 
 The usage of @code{compute-getter-method} and @code{compute-setter-method}
-is described in @ref{MOP Specification}.
+is described in @ref{Class Definition Protocol}.
 
 @code{compute-cpl} and @code{compute-get-n-set} are called by the
 standard @code{initialize} method for classes whose metaclass is
@@ -2762,152 +2512,6 @@ behaviour, by not calling @code{(next-method)} at all, but more
 typically it would perform additional class initialization steps before
 and/or after calling @code{(next-method)} for the standard behaviour.
 
-@node Customizing Instance Creation
-@subsection Customizing Instance Creation
-
-@code{make <class> . @var{initargs}} (method)
-
-@itemize @bullet
-@item
-@code{allocate-instance @var{class} @var{initargs}} (generic)
-
-The applied @code{allocate-instance} method should allocate storage for
-a new instance of class @var{class} and return the uninitialized instance.
-
-@item
-@code{initialize @var{instance} @var{initargs}} (generic)
-
-@var{instance} is the uninitialized instance returned by
-@code{allocate-instance}.  The applied method should initialize the new
-instance in whatever sense is appropriate for its class.  The method's
-return value is ignored.
-@end itemize
-
-@code{make} itself is a generic function.  Hence the @code{make}
-invocation itself can be customized in the case where the new instance's
-metaclass is more specialized than the default @code{<class>}, by
-defining a @code{make} method that is specialized to that metaclass.
-
-Normally, however, the method for classes with metaclass @code{<class>}
-will be applied.  This method calls two generic functions:
-
-@itemize @bullet
-@item
-(allocate-instance @var{class} . @var{initargs})
-
-@item
-(initialize @var{instance} . @var{initargs})
-@end itemize
-
-@code{allocate-instance} allocates storage for and returns the new
-instance, uninitialized.  You might customize @code{allocate-instance},
-for example, if you wanted to provide a GOOPS wrapper around some other
-object programming system.
-
-To do this, you would create a specialized metaclass, which would act as
-the metaclass for all classes and instances from the other system.  Then
-define an @code{allocate-instance} method, specialized to that
-metaclass, which calls a Guile primitive C function, which in turn
-allocates the new instance using the interface of the other object
-system.
-
-In this case, for a complete system, you would also need to customize a
-number of other generic functions like @code{make} and
-@code{initialize}, so that GOOPS knows how to make classes from the
-other system, access instance slots, and so on.
-
-@code{initialize} initializes the instance that is returned by
-@code{allocate-instance}.  The standard GOOPS methods perform
-initializations appropriate to the instance class.
-
-@itemize @bullet
-@item
-At the least specialized level, the method for instances of type
-@code{<object>} performs internal GOOPS instance initialization, and
-initializes the instance's slots according to the slot definitions and
-any slot initialization keywords that appear in @var{initargs}.
-
-@item
-The method for instances of type @code{<class>} calls
-@code{(next-method)}, then performs the class initializations described
-in @ref{Customizing Class Definition}.
-
-@item
-and so on for generic functions, method, operator classes @dots{}
-@end itemize
-
-Similarly, you can customize the initialization of instances of any
-application-defined class by defining an @code{initialize} method
-specialized to that class.
-
-Imagine a class whose instances' slots need to be initialized at
-instance creation time by querying a database.  Although it might be
-possible to achieve this a combination of @code{#:init-thunk} keywords
-and closures in the slot definitions, it is neater to write an
-@code{initialize} method for the class that queries the database once
-and initializes all the dependent slot values according to the results.
-
-@node Class Redefinition
-@subsection Class Redefinition
-
-The default @code{class-redefinition} method, specialized for classes
-with the default metaclass @code{<class>}, has the following internal
-protocol.
-
-@code{class-redefinition (@var{old <class>}) (@var{new <class>})}
-(method)
-
-@itemize @bullet
-@item
-@code{remove-class-accessors! @var{old}} (generic)
-
-@item
-@code{update-direct-method! @var{method} @var{old} @var{new}} (generic)
-
-@item
-@code{update-direct-subclass! @var{subclass} @var{old} @var{new}} (generic)
-@end itemize
-
-This protocol cleans up things that the definition of the old class
-once changed and modifies things to work with the new class.
-
-The default @code{remove-class-accessors!} method removes the
-accessor methods of the old class from all classes which they
-specialize.
-
-The default @code{update-direct-method!} method substitutes the new
-class for the old in all methods specialized to the old class.
-
-The default @code{update-direct-subclass!} method invokes
-@code{class-redefinition} recursively to handle the redefinition of
-subclasses.
-
-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 @code{change-class}.
-
-The default @code{change-class} method copies slot values from the old
-to the modified instance, and initializes new slots, as described in
-@ref{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.
-
-@code{change-class (@var{old-instance <object>}) (@var{new <class>})} (method)
-
-@itemize @bullet
-@item
-@code{update-instance-for-different-class @var{old-instance} @var{new-instance}} (generic)
-
-@code{change-class} invokes @code{update-instance-for-different-class}
-as the last thing that it does before returning.  The applied method can
-make any further adjustments to @var{new-instance} that are required to
-complete or modify the change of class.  The return value from the
-applied method is ignored.
-
-The default @code{update-instance-for-different-class} method does
-nothing.
-@end itemize
 
 @node Method Definition
 @subsection Method Definition
@@ -2917,7 +2521,9 @@ nothing.
 @itemize @bullet
 @item
 @code{add-method! @var{target} @var{method}} (generic)
+@end itemize
 
+@noindent
 @code{define-method} invokes the @code{add-method!} generic function to
 handle adding the new method to a variety of possible targets.  GOOPS
 includes methods to handle @var{target} as
@@ -2935,12 +2541,12 @@ a primitive generic (@pxref{Extending Primitives})
 
 By defining further methods for @code{add-method!}, you can
 theoretically handle adding methods to further types of target.
-@end itemize
+
 
 @node Method Definition Internals
 @subsection Method Definition Internals
 
-@code{define-method}
+@code{define-method}:
 
 @itemize @bullet
 @item
@@ -2960,7 +2566,7 @@ calls @code{add-method!} to add this method to the relevant generic
 function.
 @end itemize
 
-@deffn syntax method (parameter @dots{}) . body
+@deffn syntax method (parameter @dots{}) body @dots{}
 Make a method whose specializers are defined by the classes in
 @var{parameter}s and whose procedure definition is constructed from the
 @var{parameter} symbols and @var{body} forms.
@@ -2970,7 +2576,8 @@ The @var{parameter} and @var{body} parameters should be as for
 define-method}).
 @end deffn
 
-@code{method}
+@noindent
+@code{method}:
 
 @itemize @bullet
 @item
@@ -2996,6 +2603,7 @@ parameter combinations to which this method will be applicable.
 function parameters when this method is invoked.
 @end deffn
 
+@noindent
 @code{make-method} is a simple wrapper around @code{make} with metaclass
 @code{<method>}.
 
@@ -3096,44 +2704,233 @@ accessor, passing the setter generic function as the value of the
 @node Generic Function Invocation
 @subsection Generic Function Invocation
 
-[ *fixme* Description required here. ]
+There is a detailed and customizable protocol involved in the process of
+invoking a generic function --- i.e., in the process of deciding which
+of the generic function's methods are applicable to the current
+arguments, and which one of those to apply.  Here is a summary diagram
+of the generic functions involved.
 
-@code{apply-generic}
+@noindent
+@code{apply-generic} (generic)
 
 @itemize @bullet
 @item
-@code{no-method}
+@code{no-method} (generic)
 
 @item
-@code{compute-applicable-methods}
+@code{compute-applicable-methods} (generic)
 
 @item
-@code{sort-applicable-methods}
+@code{sort-applicable-methods} (generic)
 
+@itemize @bullet
 @item
-@code{apply-methods}
+@code{method-more-specific?} (generic)
+@end itemize
+
+@item
+@code{apply-methods} (generic)
+
+@itemize @bullet
+@item
+@code{apply-method} (generic)
+
+@item
+@code{no-next-method} (generic)
+@end itemize
 
 @item
 @code{no-applicable-method}
 @end itemize
 
-@code{sort-applicable-methods}
+We do not yet have full documentation for these.  Please refer to the
+code (@file{oop/goops.scm}) for details.
+
+
+@node Redefining a Class
+@section Redefining a Class
+
+Suppose that a class @code{<my-class>} is defined using @code{define-class}
+(@pxref{Class Definition,, define-class}), with slots that have
+accessor functions, and that an application has created several instances
+of @code{<my-class>} using @code{make} (@pxref{Instance Creation,,
+make}).  What then happens if @code{<my-class>} is redefined by calling
+@code{define-class} again?
+
+@menu
+* Default Class Redefinition Behaviour::
+* Customizing Class Redefinition::
+@end menu
+
+@node Default Class Redefinition Behaviour
+@subsection Default Class Redefinition Behaviour
+
+GOOPS' default answer to this question is as follows.
 
 @itemize @bullet
 @item
-@code{method-more-specific?}
-@end itemize
+All existing direct instances of @code{<my-class>} are converted to be
+instances of the new class.  This is achieved by preserving the values
+of slots that exist in both the old and new definitions, and
+initializing the values of new slots in the usual way (@pxref{Instance
+Creation,, make}).
 
-@code{apply-methods}
+@item
+All existing subclasses of @code{<my-class>} are redefined, as though
+the @code{define-class} expressions that defined them were re-evaluated
+following the redefinition of @code{<my-class>}, and the class
+redefinition process described here is applied recursively to the
+redefined subclasses.
 
-@itemize @bullet
 @item
-@code{apply-method}
+Once all of its instances and subclasses have been updated, the class
+metaobject previously bound to the variable @code{<my-class>} is no
+longer needed and so can be allowed to be garbage collected.
 @end itemize
 
-@code{next-method}
+To keep things tidy, GOOPS also needs to do a little housekeeping on
+methods that are associated with the redefined class.
 
 @itemize @bullet
 @item
-@code{no-next-method}
+Slot accessor methods for slots in the old definition should be removed
+from their generic functions.  They will be replaced by accessor methods
+for the slots of the new class definition.
+
+@item
+Any generic function method that uses the old @code{<my-class>} metaobject
+as one of its formal parameter specializers must be updated to refer to
+the new @code{<my-class>} metaobject.  (Whenever a new generic function
+method is defined, @code{define-method} adds the method to a list stored
+in the class metaobject for each class used as a formal parameter
+specializer, so it is easy to identify all the methods that must be
+updated when a class is redefined.)
 @end itemize
+
+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@dots{}
+
+@node Customizing Class Redefinition
+@subsection Customizing Class Redefinition
+
+When @code{define-class} notices that a class is being redefined, it
+constructs the new class metaobject as usual, then invokes the
+@code{class-redefinition} generic function with the old and new classes
+as arguments.  Therefore, if the old or new classes have metaclasses
+other than the default @code{<class>}, class redefinition behaviour can
+be customized by defining a @code{class-redefinition} method that is
+specialized for the relevant metaclasses.
+
+@deffn generic class-redefinition
+Handle the class redefinition from @var{old-class} to @var{new-class},
+and return the new class metaobject that should be bound to the
+variable specified by @code{define-class}'s first argument.
+@end deffn
+
+@deffn method class-redefinition (old-class <class>) (new-class <class>)
+Implements GOOPS' default class redefinition behaviour, as described in
+@ref{Default Class Redefinition Behaviour}.  Returns the metaobject
+for the new class definition.
+@end deffn
+
+The default @code{class-redefinition} method, for classes with the
+default metaclass @code{<class>}, calls the following generic functions,
+which could of course be individually customized.
+
+@deffn generic remove-class-accessors! old
+The default @code{remove-class-accessors!} method removes the accessor
+methods of the old class from all classes which they specialize.
+@end deffn
+
+@deffn generic update-direct-method! method old new
+The default @code{update-direct-method!} method substitutes the new
+class for the old in all methods specialized to the old class.
+@end deffn
+
+@deffn generic update-direct-subclass! subclass old new
+The default @code{update-direct-subclass!} method invokes
+@code{class-redefinition} recursively to handle the redefinition of
+subclasses.
+@end deffn
+
+An alternative class redefinition strategy could be to leave all
+existing instances as instances of the old class, but accepting that the
+old class is now ``nameless'', since its name has been taken over by the
+new definition.  In this strategy, any existing subclasses could also
+be left as they are, on the understanding that they inherit from a nameless
+superclass.
+
+This strategy is easily implemented in GOOPS, by defining a new metaclass,
+that will be used as the metaclass for all classes to which the strategy
+should apply, and then defining a @code{class-redefinition} method that
+is specialized for this metaclass:
+
+@example
+(define-class <can-be-nameless> (<class>))
+
+(define-method (class-redefinition (old <can-be-nameless>)
+                                   (new <class>))
+  new)
+@end example
+
+When customization can be as easy as this, aren't you glad that GOOPS
+implements the far more difficult strategy as its default!
+
+
+@node Changing the Class of an Instance
+@section Changing the Class of an Instance
+
+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 slots is referenced or set.  GOOPS modifies each
+instance by calling the generic function @code{change-class}.
+
+More generally, you can change the class of an existing instance at any
+time by invoking the generic function @code{change-class} with two
+arguments: the instance and the new class.
+
+The default method for @code{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 (@pxref{Classes,,
+slot-init-function}).
+
+@deffn generic change-class instance new-class
+@end deffn
+
+@deffn {method} change-class (obj <object>) (new <class>)
+Modify instance @var{obj} to make it an instance of class @var{new}.
+
+The value of each of @var{obj}'s slots is preserved only if a similarly named
+slot exists in @var{new}; any other slot values are discarded.
+
+The slots in @var{new} that do not correspond to any of @var{obj}'s
+pre-existing slots are initialized according to @var{new}'s slot definitions'
+init functions.
+@end deffn
+
+The default @code{change-class} method also invokes another generic
+function, @code{update-instance-for-different-class}, as the last thing
+that it does before returning.  The applied
+@code{update-instance-for-different-class} method can make any further
+adjustments to @var{new-instance} that are required to complete or
+modify the change of class.  The return value from the applied method is
+ignored.
+
+@deffn generic update-instance-for-different-class old-instance new-instance
+A generic function that can be customized to put finishing touches to an
+instance whose class has just been changed.  The default
+@code{update-instance-for-different-class} method does nothing.
+@end deffn
+
+Customized change of class behaviour can be implemented by defining
+@code{change-class} methods that are specialized either by the class
+of the instances to be modified or by the metaclass of the new class.