From 53e87d8996712548798736a2b85f9fccf200e76a Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Mon, 31 Mar 2003 15:20:41 +0000 Subject: [PATCH] 0.pre8.21: Merge patch from Gerd Moellmann (sbcl-devel 2003-03-29) to make FIND-CLASS (SB-PCL:FIND-CLASS as was) available earlier in the MOP methods (requested by KMR sbcl-devel 2003-03-28) ... (SETF FIND-CLASS) in UPDATE-CLASS. --- src/pcl/std-class.lisp | 3 ++- tests/mop.impure.lisp | 12 ++++++++++++ version.lisp-expr | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/pcl/std-class.lisp b/src/pcl/std-class.lisp index 558d920..12d3ecb 100644 --- a/src/pcl/std-class.lisp +++ b/src/pcl/std-class.lisp @@ -507,8 +507,8 @@ (make-class-predicate-name (class-name class)))))) (add-direct-subclasses class direct-superclasses) - (update-class class nil) (make-class-predicate class predicate-name) + (update-class class nil) (add-slot-accessors class direct-slots)) (defmethod shared-initialize :before ((class class) slot-names &key name) @@ -742,6 +742,7 @@ (return-from update-class)) (when (or finalizep (class-finalized-p class) (not (class-has-a-forward-referenced-superclass-p class))) + (setf (find-class (class-name class)) class) (update-cpl class (compute-class-precedence-list class)) ;; This invocation of UPDATE-SLOTS, in practice, finalizes the ;; class. The hoops above are to ensure that FINALIZE-INHERITANCE diff --git a/tests/mop.impure.lisp b/tests/mop.impure.lisp index b70ca1a..9f2e9e5 100644 --- a/tests/mop.impure.lisp +++ b/tests/mop.impure.lisp @@ -134,5 +134,17 @@ (assert (null *e-c-u-c-arg-order*)) (defclass e-c-u-c-arg-order () ()) (assert (eq *e-c-u-c-arg-order* t)) + +;;; verify that FIND-CLASS works after FINALIZE-INHERITANCE +(defclass automethod-class (standard-class) ()) +(defmethod validate-superclass ((c1 automethod-class) (c2 standard-class)) + t) +(defmethod finalize-inheritance :after ((x automethod-class)) + (format t "~&~S ~S~%" x (find-class (class-name x)))) +(defclass automethod-object () () + (:metaclass automethod-class)) +(defvar *automethod-object* (make-instance 'automethod-object)) +(assert (typep *automethod-object* 'automethod-object)) + ;;;; success (sb-ext:quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index 1c26faa..4f2e262 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.pre8.20" +"0.pre8.21" -- 1.7.10.4