chiark / gitweb /
src/final.lisp, src/frontend.lisp: Compile methods before dumping.
[sod] / src / class-make-impl.lisp
index 1daab398cb492c56195e2faa66463ea40d42138e..f9d5734b472de5f1f8c9c140e9ab3cb14ba19cc4 100644 (file)
@@ -87,7 +87,8 @@ (defmethod make-sod-slot
                               :location (file-location location)
                               :pset pset)))
       (with-slots (slots) class
                               :location (file-location location)
                               :pset pset)))
       (with-slots (slots) class
-       (setf slots (append slots (list slot)))))))
+       (setf slots (append slots (list slot))))
+      slot)))
 
 (defmethod shared-initialize :after ((slot sod-slot) slot-names &key pset)
   "This method does nothing.
 
 (defmethod shared-initialize :after ((slot sod-slot) slot-names &key pset)
   "This method does nothing.
@@ -111,7 +112,8 @@ (defmethod make-sod-instance-initializer
                         (file-location location))))
       (with-slots (instance-initializers) class
        (setf instance-initializers
                         (file-location location))))
       (with-slots (instance-initializers) class
        (setf instance-initializers
-             (append instance-initializers (list initializer)))))))
+             (append instance-initializers (list initializer))))
+      initializer)))
 
 (defmethod make-sod-class-initializer
     ((class sod-class) nick name value-kind value-form pset
 
 (defmethod make-sod-class-initializer
     ((class sod-class) nick name value-kind value-form pset
@@ -124,7 +126,8 @@ (defmethod make-sod-class-initializer
                         (file-location location))))
       (with-slots (class-initializers) class
        (setf class-initializers
                         (file-location location))))
       (with-slots (class-initializers) class
        (setf class-initializers
-             (append class-initializers (list initializer)))))))
+             (append class-initializers (list initializer))))
+      initializer)))
 
 (defmethod make-sod-initializer-using-slot
     ((class sod-class) (slot sod-slot)
 
 (defmethod make-sod-initializer-using-slot
     ((class sod-class) (slot sod-slot)
@@ -152,15 +155,19 @@ (defmethod shared-initialize :after
 (defmethod make-sod-message
     ((class sod-class) name type pset &optional location)
   (with-default-error-location (location)
 (defmethod make-sod-message
     ((class sod-class) name type pset &optional location)
   (with-default-error-location (location)
-    (let ((message (make-instance (get-property pset :message-class :symbol
-                                               'standard-message)
-                                 :class class
-                                 :name name
-                                 :type type
-                                 :location (file-location location)
-                                 :pset pset)))
+    (let* ((msg-class (or (get-property pset :message-class :symbol)
+                         (and (get-property pset :combination :keyword)
+                              'aggregating-message)
+                         'standard-message))
+          (message (make-instance msg-class
+                                  :class class
+                                  :name name
+                                  :type type
+                                  :location (file-location location)
+                                  :pset pset)))
       (with-slots (messages) class
       (with-slots (messages) class
-       (setf messages (append messages (list message)))))))
+       (setf messages (append messages (list message))))
+      message)))
 
 (defmethod shared-initialize :after
     ((message sod-message) slot-names &key pset)
 
 (defmethod shared-initialize :after
     ((message sod-message) slot-names &key pset)
@@ -185,7 +192,8 @@ (defmethod make-sod-method
                                                  type body pset
                                                  (file-location location))))
       (with-slots (methods) class
                                                  type body pset
                                                  (file-location location))))
       (with-slots (methods) class
-       (setf methods (append methods (list method)))))))
+       (setf methods (append methods (list method))))
+      method)))
 
 (defmethod make-sod-method-using-message
     ((message sod-message) (class sod-class) type body pset location)
 
 (defmethod make-sod-method-using-message
     ((message sod-message) (class sod-class) type body pset location)
@@ -211,7 +219,8 @@ (defmethod shared-initialize :after
   (with-slots (body type) method
     (unless (or (not body)
                (every (lambda (arg)
   (with-slots (body type) method
     (unless (or (not body)
                (every (lambda (arg)
-                        (or (argument-name arg)
+                        (or (eq arg :ellipsis)
+                            (argument-name arg)
                             (eq (argument-type arg) (c-type void))))
                       (c-function-arguments type)))
       (error "Abstract declarators not permitted in method definitions")))
                             (eq (argument-type arg) (c-type void))))
                       (c-function-arguments type)))
       (error "Abstract declarators not permitted in method definitions")))