chiark / gitweb /
src/class-finalize-{proto,impl}.lisp (finalize-sod-class): Add `:around'.
[sod] / src / class-finalize-proto.lisp
index c7de25561efe27b8a794504699f4a2818bef6e8d..80d0c121ca184554d30d31213e5092f7995eb2d2 100644 (file)
@@ -7,7 +7,7 @@
 
 ;;;----- Licensing notice ---------------------------------------------------
 ;;;
-;;; This file is part of the Sensble Object Design, an object system for C.
+;;; This file is part of the Sensible Object Design, an object system for C.
 ;;;
 ;;; SOD is free software; you can redistribute it and/or modify
 ;;; it under the terms of the GNU General Public License as published by
@@ -28,10 +28,12 @@ (cl:in-package #:sod)
 ;;;--------------------------------------------------------------------------
 ;;; Protocol definition.
 
+(export 'compute-cpl)
 (defgeneric compute-cpl (class)
   (:documentation
    "Returns the class precedence list for CLASS."))
 
+(export 'compute-chains)
 (defgeneric compute-chains (class)
   (:documentation
    "Compute the layout chains for CLASS.
@@ -50,6 +52,15 @@ (defgeneric compute-chains (class)
    If the chains are ill-formed (i.e., not distinct) then an error is
    signalled."))
 
+(export 'guess-metaclass)
+(defgeneric guess-metaclass (class)
+  (:documentation
+   "Determine a suitable metaclass for the CLASS.
+
+   The default behaviour is to choose the most specific metaclass of any of
+   the direct superclasses of CLASS, or to signal an error if that failed."))
+
+(export 'check-sod-class)
 (defgeneric check-sod-class (class)
   (:documentation
    "Check the CLASS for validity.
@@ -70,9 +81,13 @@ (defgeneric check-sod-class (class)
      * The chosen metaclass is actually a subclass of all of the
        superclasses' metaclasses.
 
-   Returns true if all is well; false (and signals errors) if anything was
-   wrong."))
+   If no attempt has previously been made to finalize the class, then errors
+   are signalled for the problems found.  If finalizing it has been tried
+   before and failed (or this is a recursive attempt to finalize the class)
+   then nil is returned immediately.  Otherwise a non-nil value is
+   returned."))
 
+(export 'finalize-sod-class)
 (defgeneric finalize-sod-class (class)
   (:documentation
    "Computes all of the gory details about a class.
@@ -91,6 +106,10 @@ (defgeneric finalize-sod-class (class)
 
      * The class is checked for compiance with the well-formedness rules.
 
-     * The layout chains are computed."))
+     * The layout chains are computed.
+
+   User methods can assume that the class in question has not yet been
+   finalized.  Errors during finalization can be reported in the usual
+   way."))
 
 ;;;----- That's all, folks --------------------------------------------------