X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/a7c3f7ae7e2453301bcfbdc7a0c5dca71b54622a..97d10f8b1f631cd32ea5ac9118b253cb4142d391:/src/class-make-proto.lisp diff --git a/src/class-make-proto.lisp b/src/class-make-proto.lisp index 7305807..d075304 100644 --- a/src/class-make-proto.lisp +++ b/src/class-make-proto.lisp @@ -59,14 +59,6 @@ :pset pset))) class))) -(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.")) - ;;;-------------------------------------------------------------------------- ;;; Slots and slot initializers. @@ -85,7 +77,7 @@ (export 'make-sod-instance-initializer) (defgeneric make-sod-instance-initializer - (class nick name value-kind value-form pset &optional location) + (class nick name value pset &optional location) (:documentation "Construct and attach an instance slot initializer, to CLASS. @@ -98,7 +90,7 @@ (export 'make-sod-class-initializer) (defgeneric make-sod-class-initializer - (class nick name value-kind value-form pset &optional location) + (class nick name value pset &optional location) (:documentation "Construct and attach a class slot initializer, to CLASS. @@ -111,7 +103,7 @@ (export 'make-sod-initializer-using-slot) (defgeneric make-sod-initializer-using-slot - (class slot init-class value-kind value-form pset location) + (class slot init-class value pset location) (:documentation "Common construction protocol for slot initializers. @@ -132,6 +124,57 @@ You are not expected to call this generic function directly; it's more useful as a place to hang methods for custom initializer classes.")) +(export 'make-sod-user-initarg) +(defgeneric make-sod-user-initarg + (class name type pset &optional default location) + (:documentation + "Attach a user-defined initialization keyword argument to the CLASS. + + The new argument has the given NAME and TYPE, and maybe a DEFAULT value. + Currently, initialization arguments are just dumb objects held in a + list.")) + +(export 'make-sod-slot-initarg) +(defgeneric make-sod-slot-initarg + (class name nick slot-name pset &optional location) + (:documentation + "Attach an initialization keyword argument to a slot by name. + + The default method uses `find-instance-slot-by-name' to find the slot, and + `make-slot-initarg-using-slot' to actually make and attach the initarg.")) + +(export 'make-sod-slot-initarg-using-slot) +(defgeneric make-sod-slot-initarg-using-slot + (class name slot pset &optional location) + (:documentation + "Attach an initialization keyword argument to a SLOT. + + The argument's type is taken from the slot type. Slot initargs can't have + defaults: the slot's most-specific initializer is used instead. + + You are not expected to call this generic function directly; it's more + useful as a place to hang methods for custom classes.")) + +(export 'sod-initarg-argument) +(defgeneric sod-initarg-argument (initarg) + (:documentation "Returns an `argument' object for the initarg.")) + +(export 'make-sod-class-initfrag) +(defgeneric make-sod-class-initfrag (class frag pset &optional location) + (:documentation + "Attach an initialization fragment FRAG to the CLASS. + + Currently, initialization fragments are just dumb objects held in a + list.")) + +(export 'make-sod-class-tearfrag) +(defgeneric make-sod-class-tearfrag (class frag pset &optional location) + (:documentation + "Attach a teardown fragment FRAG to the CLASS. + + Currently, teardown fragments are just dumb objects held in a + list.")) + ;;;-------------------------------------------------------------------------- ;;; Messages and methods.