From: Nikodemus S. <de...@us...> - 2009-06-02 18:33:56
|
Update of /cvsroot/sbcl/sbcl/src/pcl In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv23868/src/pcl Modified Files: init.lisp Log Message: 1.0.28.74: SHARED-INITIALIZE should initialize unbound :CLASS slots * This has been around for a while, but despite the misleading comment in the source the spec is clear enough. Index: init.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/src/pcl/init.lisp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- init.lisp 22 Dec 2008 10:50:36 -0000 1.21 +++ init.lisp 2 Jun 2009 18:33:52 -0000 1.22 @@ -101,10 +101,10 @@ (flet ((initialize-slot-from-initarg (class instance slotd) (let ((slot-initargs (slot-definition-initargs slotd))) (doplist (initarg value) initargs - (when (memq initarg slot-initargs) - (setf (slot-value-using-class class instance slotd) - value) - (return t))))) + (when (memq initarg slot-initargs) + (setf (slot-value-using-class class instance slotd) + value) + (return t))))) (initialize-slot-from-initfunction (class instance slotd) ;; CLHS: If a before method stores something in a slot, ;; that slot won't be initialized from its :INITFORM, if any. @@ -127,12 +127,9 @@ unless (initialize-slot-from-initarg class instance slotd) collect slotd))) (dolist (slotd initfn-slotds) - (unless (eq (slot-definition-allocation slotd) :class) - ;; :ALLOCATION :CLASS slots use the :INITFORM when class is defined - ;; or redefined, not when instances are allocated. - (when (or (eq t slot-names) - (memq (slot-definition-name slotd) slot-names)) - (initialize-slot-from-initfunction class instance slotd))))) + (when (or (eq t slot-names) + (memq (slot-definition-name slotd) slot-names)) + (initialize-slot-from-initfunction class instance slotd)))) instance)) ;;; If initargs are valid return nil, otherwise signal an error. |