chiark / gitweb /
src/c-types-proto.lisp: Fix docstring.
[sod] / src / class-make-proto.lisp
index 01e18eb022deae4cd11a7e60d1e41b4532e5a3e8..8b024bd83e8b08dc880c1a8ff9ed884d042b08c0 100644 (file)
@@ -45,8 +45,14 @@ (defun make-sod-class (name superclasses pset &optional location)
 
   (with-default-error-location (location)
     (let* ((pset (property-set pset))
 
   (with-default-error-location (location)
     (let* ((pset (property-set pset))
-          (class (make-instance (get-property pset :lisp-metaclass :symbol
-                                              'sod-class)
+          (best-class (or (get-property pset :lisp-metaclass :symbol nil)
+                          (if superclasses
+                              (maximum (mapcar #'class-of superclasses)
+                                       #'subtypep
+                                       (format nil "Lisp metaclass for ~A"
+                                               name))
+                              'sod-class)))
+          (class (make-instance best-class
                                 :name name
                                 :superclasses superclasses
                                 :location (file-location location)
                                 :name name
                                 :superclasses superclasses
                                 :location (file-location location)
@@ -136,12 +142,13 @@ (defgeneric make-sod-message (class name type pset &optional location)
 
    This is the main constructor function for messages.  This is a generic
    function primarily so that the CLASS can intervene in the construction
 
    This is the main constructor function for messages.  This is a generic
    function primarily so that the CLASS can intervene in the construction
-   process.  The default method uses the `:message-class' property
-   (defaulting to `sod-message') to choose a (CLOS) class to instantiate.
-   The message is then constructed by `make-instance' passing the arguments
-   as initargs; further behaviour is left to the standard CLOS instance
-   construction protocol; for example, `sod-message' defines an
-   `:after'-method on `shared-initialize'."))
+   process.  The default method uses the `:message-class' property to choose
+   a (CLOS) class to instantiate; if no such property is provided but a
+   `combination' property is present, then `aggregating-message' is chosen;
+   otherwise `standard-message' is used.  The message is then constructed by
+   `make-instance' passing the arguments as initargs; further behaviour is
+   left to the standard CLOS instance construction protocol; for example,
+   `sod-message' defines an `:after'-method on `shared-initialize'."))
 
 (export 'make-sod-method)
 (defgeneric make-sod-method
 
 (export 'make-sod-method)
 (defgeneric make-sod-method