X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/3a774b55edfea441c1715994924c2999e9202143..2c6153373f927d948a74b283ebb16330af8ee49a:/src/class-finalize-proto.lisp?ds=sidebyside diff --git a/src/class-finalize-proto.lisp b/src/class-finalize-proto.lisp index 2f589b8..7a64ae3 100644 --- a/src/class-finalize-proto.lisp +++ b/src/class-finalize-proto.lisp @@ -92,13 +92,19 @@ If the chains are ill-formed (i.e., not distinct) then an error is signalled.")) -(export 'guess-metaclass) -(defgeneric guess-metaclass (class) +(export 'check-class-initializer) +(defgeneric check-class-initializer (slot class) (:documentation - "Determine a suitable metaclass for the CLASS. + "Check that SLOT has an appropriate initializer. - 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.")) + Signal an appropriate continuable error, possibly protected by + `finalization-error'. + + The initializer might come either from the SLOT's defining class (which it + already knows), or from the prospective instance CLASS, of which the + defining class will be (a superclass of) the metaclass. Or, if the slot + is magical, then the initial value might come from somewhere else and it + might be forbidden for a programmer to set it explicitly.")) (export 'check-sod-class) (defgeneric check-sod-class (class)