From e204f990b868f03fa6aef17860ce86c854c30fe8 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Thu, 20 Apr 2006 17:29:13 +0000 Subject: [PATCH] 0.9.11.45: More intuitive FINALIZE-INHERITANCE behaviour ... the change for 0.9.11 fixing forward references and TYPEP made finalize-inheritance call itself recursively on subclasses. This broke clg, which is now fixed, but still... ... might as well fix the odd behaviour, and add a test for it. --- NEWS | 25 ++++++++++++--------- src/pcl/std-class.lisp | 7 ++++-- tests/mop-15.impure-cload.lisp | 48 ++++++++++++++++++++++++++++++++++++++++ version.lisp-expr | 2 +- 4 files changed, 69 insertions(+), 13 deletions(-) create mode 100644 tests/mop-15.impure-cload.lisp diff --git a/NEWS b/NEWS index cfb3cfd..a60e559 100644 --- a/NEWS +++ b/NEWS @@ -1,15 +1,10 @@ ;;;; -*- coding: utf-8; -*- changes in sbcl-0.9.12 relative to sbcl-0.9.11: - * Enhancements for sbcl running on the Windows operating system: - ** (user-homedir-pathname) and default initialization file - locations now know about the user's "Documents and Settings" - directory (thanks to Yaroslav Kavenchuk) - ** run-program is implemented (thanks to Mike Thomas) - ** sockets support (thanks to Timothy Ritchey) - ** better backtrace support (thanks to Alastair Bridgewater) - ** sb-grovel supported - ** asdf-install and sb-posix work somewhat - ** capable of running Slime using SWANK:*COMMUNICATION-STYLE* NIL + * minor incompatible change: in sbcl-0.9.11 (but not earlier + versions) SB-MOP:FINALIZE-INHERITANCE would recursively descend + into subclasses of the finalized class. Now user calls to + FINALIZE-INHERITANCE finalize just the one class, and calls by the + system return before any subclasses are finalized. * minor incompatible change: The reader no longer ignores errors regarding non-existent packages in #+ and #- feature tests. * new feature: command line options --no-sysinit, --no-userinit to @@ -46,6 +41,16 @@ changes in sbcl-0.9.12 relative to sbcl-0.9.11: (SETF DOCUMENTATION); only find and set documentation for structure names for the STRUCTURE doc-type. (suggested by Gary King) + * improvements to the Win32/x86 port: + ** (user-homedir-pathname) and default initialization file + locations now know about the user's "Documents and Settings" + directory (thanks to Yaroslav Kavenchuk) + ** run-program is implemented (thanks to Mike Thomas) + ** sockets support (thanks to Timothy Ritchey) + ** better backtrace support (thanks to Alastair Bridgewater) + ** sb-grovel supported + ** asdf-install and sb-posix work somewhat + ** capable of running Slime using SWANK:*COMMUNICATION-STYLE* NIL * improvements to the Solaris/x86 port: ** works on Solaris 11/Solaris Express ** floating-point exception handling support diff --git a/src/pcl/std-class.lisp b/src/pcl/std-class.lisp index d40e7cf..c3216ba 100644 --- a/src/pcl/std-class.lisp +++ b/src/pcl/std-class.lisp @@ -794,6 +794,8 @@ (not (class-finalized-p class)) (not (class-has-a-forward-referenced-superclass-p class))) (finalize-inheritance class) + (dolist (sub (class-direct-subclasses class)) + (update-class sub nil)) (return-from update-class)) (when (or finalizep (class-finalized-p class) (not (class-has-a-forward-referenced-superclass-p class))) @@ -808,8 +810,9 @@ (update-gfs-of-class class) (update-initargs class (compute-default-initargs class)) (update-ctors 'finalize-inheritance :class class)) - (dolist (sub (class-direct-subclasses class)) - (update-class sub nil)))) + (unless finalizep + (dolist (sub (class-direct-subclasses class)) + (update-class sub nil))))) (define-condition cpl-protocol-violation (reference-condition error) ((class :initarg :class :reader cpl-protocol-violation-class) diff --git a/tests/mop-15.impure-cload.lisp b/tests/mop-15.impure-cload.lisp new file mode 100644 index 0000000..7be745c --- /dev/null +++ b/tests/mop-15.impure-cload.lisp @@ -0,0 +1,48 @@ +;;;; miscellaneous side-effectful tests of the MOP + +;;;; This software is part of the SBCL system. See the README file for +;;;; more information. +;;;; +;;;; While most of SBCL is derived from the CMU CL system, the test +;;;; files (like this one) were written from scratch after the fork +;;;; from CMU CL. +;;;; +;;;; This software is in the public domain and is provided with +;;;; absolutely no warranty. See the COPYING and CREDITS files for +;;;; more information. + +;;; this file tests that FINALIZE-INHERITANCE behaves intuitively: +;;; that when FINALIZE-INHERITANCE is called on a class, it returns +;;; before subclasses are finalized. + +(defpackage "MOP-15" + (:use "CL" "SB-MOP")) + +(in-package "MOP-15") + +(defclass mop-15-class (standard-class) ()) + +(defmethod validate-superclass ((s mop-15-class) (super standard-class)) + t) + +(defvar *count* 0) +(defvar *max-count* 0) + +(defmethod finalize-inheritance ((c mop-15-class)) + (let ((*count* (1+ *count*))) + (when (> *count* *max-count*) + (setf *max-count* *count*)) + (call-next-method))) + +(defclass sub (super) + () + (:metaclass mop-15-class)) + +(defclass super () + () + (:metaclass mop-15-class)) + +(finalize-inheritance (find-class 'super)) +(finalize-inheritance (find-class 'sub)) + +(assert (= *max-count* 1)) diff --git a/version.lisp-expr b/version.lisp-expr index aaf0c44..6e83ca2 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.11.44" +"0.9.11.45" -- 1.7.10.4