X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/e45a106df3272c787444bc6f7b8920016b7fc677..fe471148e34552002cfb25d235f62fd557865dda:/src/class-finalize-proto.lisp 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)