chiark / gitweb /
src/method-impl.lisp: Initialize `suppliedp' flags properly.
[sod] / src / class-layout-impl.lisp
index 950db2b54bb0d9dcb400f5a6fe416ebe3d6bd61a..d6b3e6da3064e0260d388f55ec2ae929df722798 100644 (file)
@@ -7,7 +7,7 @@
 
 ;;;----- Licensing notice ---------------------------------------------------
 ;;;
-;;; This file is part of the Sensble Object Design, an object system for C.
+;;; This file is part of the Sensible Object Design, an object system for C.
 ;;;
 ;;; SOD is free software; you can redistribute it and/or modify
 ;;; it under the terms of the GNU General Public License as published by
@@ -41,16 +41,26 @@ (defmethod find-slot-initializer ((class sod-class) (slot sod-slot))
                :key #'sod-initializer-slot))
        (sod-class-precedence-list class)))
 
+(defmethod find-slot-initargs ((class sod-class) (slot sod-slot))
+  (mappend (lambda (super)
+            (remove-if-not (lambda (initarg)
+                             (and (typep initarg 'sod-slot-initarg)
+                                  (eq (sod-initarg-slot initarg) slot)))
+                           (sod-class-initargs super)))
+          (sod-class-precedence-list class)))
+
 (defmethod compute-effective-slot ((class sod-class) (slot sod-slot))
   (make-instance 'effective-slot
                 :slot slot
                 :class class
-                :initializer (find-slot-initializer class slot)))
+                :initializer (find-slot-initializer class slot)
+                :initargs (find-slot-initargs class slot)))
 
 ;;;--------------------------------------------------------------------------
 ;;; Special-purpose slot objects.
 
-(export 'sod-class-slot)
+(export '(sod-class-slot
+         sod-slot-initializer-function sod-slot-prepare-function))
 (defclass sod-class-slot (sod-slot)
   ((initializer-function :initarg :initializer-function
                         :type (or symbol function)
@@ -116,8 +126,8 @@ (defmethod compute-sod-effective-method
                                           (sod-class-methods super)
                                           :key #'sod-method-message
                                           :test-not #'eql))
-                               (sod-class-precedence-list class))))
-    (make-instance (message-effective-method-class message)
+                                (sod-class-precedence-list class))))
+    (make-instance (sod-message-effective-method-class message)
                   :message message
                   :class class
                   :direct-methods direct-methods)))
@@ -129,12 +139,6 @@ (defmethod compute-effective-methods ((class sod-class))
                    (sod-class-messages super)))
          (sod-class-precedence-list class)))
 
-(defmethod slot-unbound
-    (clos-class (class sod-class) (slot-name (eql 'effective-methods)))
-  (declare (ignore clos-class))
-  (setf (slot-value class 'effective-methods)
-       (compute-effective-methods class)))
-
 ;;;--------------------------------------------------------------------------
 ;;; Instance layout.
 
@@ -207,12 +211,6 @@ (defmethod compute-ilayout ((class sod-class))
                                                    (reverse chain)))
                                  (sod-class-chains class))))
 
-(defmethod slot-unbound
-    (clos-class (class sod-class) (slot-name (eql 'ilayout)))
-  (declare (ignore clos-class))
-  (setf (slot-value class 'ilayout)
-       (compute-ilayout class)))
-
 ;;;--------------------------------------------------------------------------
 ;;; Vtable layout.
 
@@ -390,10 +388,4 @@ (defmethod compute-vtables ((class sod-class))
            (compute-vtable class (reverse chain)))
          (sod-class-chains class)))
 
-(defmethod slot-unbound
-    (clos-class (class sod-class) (slot-name (eql 'vtables)))
-  (declare (ignore clos-class))
-  (setf (slot-value class 'vtables)
-       (compute-vtables class)))
-
 ;;;----- That's all, folks --------------------------------------------------