chiark / gitweb /
src/: Guess the metaclass early, unless we're explicitly bootstrapping.
[sod] / src / class-make-proto.lisp
index 0e3c5d74f2c91f245265a31c0f0c6177669171fa..2e1fe7c0ca2f4ec54a70b363382f7d3dfb0e2a5b 100644 (file)
@@ -28,6 +28,14 @@ (cl:in-package #:sod)
 ;;;--------------------------------------------------------------------------
 ;;; Classes.
 
+(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 'make-sod-class)
 (defun make-sod-class (name superclasses pset &optional location)
   "Construct and return a new SOD class with the given NAME and SUPERCLASSES.