From 7f13323739a0d2b474bfd5c740942db5a78349d6 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Tue, 10 Jun 2003 13:04:32 +0000 Subject: [PATCH] 0.8.0.60: Fix yet another Dietz bug: ... in DEFCLASS, we only redefine an existing class with name CLASS-NAME if said name is the proper name for the class; ... ask for a new class (by passing NIL to ENSURE-CLASS-USING-CLASS) otherwise. --- NEWS | 3 +++ src/pcl/std-class.lisp | 10 ++++++++-- version.lisp-expr | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index b4e3018..5c54d08 100644 --- a/NEWS +++ b/NEWS @@ -1836,6 +1836,9 @@ changes in sbcl-0.8.1 relative to sbcl-0.8.0: argument is true. ** TYPE-OF returns recognizeable subtypes of all built-in-types of which its argument is a member. + ** DEFCLASS only redefines the class named by its class-name + argument if that name is the proper name of the class; + otherwise, it creates a new class. planned incompatible changes in 0.8.x: * (not done yet, but planned:) When the profiling interface settles diff --git a/src/pcl/std-class.lisp b/src/pcl/std-class.lisp index 22c3c10..50fd53a 100644 --- a/src/pcl/std-class.lisp +++ b/src/pcl/std-class.lisp @@ -336,8 +336,14 @@ (setf (gdefinition 'load-defclass) #'real-load-defclass) -(defun ensure-class (name &rest all) - (apply #'ensure-class-using-class (find-class name nil) name all)) +(defun ensure-class (name &rest args) + (apply #'ensure-class-using-class + (let ((class (find-class name nil))) + (when (and class (eq name (class-name class))) + ;; NAME is the proper name of CLASS, so redefine it + class)) + name + args)) (defmethod ensure-class-using-class ((class null) name &rest args &key) (multiple-value-bind (meta initargs) diff --git a/version.lisp-expr b/version.lisp-expr index 3a3a291..4b18c37 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.8.0.59" +"0.8.0.60" -- 1.7.10.4