X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/11e41ddf86b4ee793f44fc0e39cb4c1869335b14..ffc2a7b8364cc459ff686cfce645079b52d11466:/src/class-layout-impl.lisp diff --git a/src/class-layout-impl.lisp b/src/class-layout-impl.lisp index fb684b7..d6b3e6d 100644 --- a/src/class-layout-impl.lisp +++ b/src/class-layout-impl.lisp @@ -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,11 +41,20 @@ :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. @@ -117,8 +126,8 @@ (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)))