From: Christophe Rhodes Date: Wed, 2 Apr 2003 11:06:48 +0000 (+0000) Subject: 0.pre8.27: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=7e00a27796fce8eb5b0ab920dda636584a011ba2;p=sbcl.git 0.pre8.27: Fix bug 20, cause it's easy now ... mostly done anyway by SB-PCL:CLASS -> CL:CLASS ... minor adjustment in logic for type declarations in methods --- diff --git a/BUGS b/BUGS index f98f768..38748d9 100644 --- a/BUGS +++ b/BUGS @@ -144,16 +144,6 @@ WORKAROUND: (FORMAT NIL "~,1G" 1.4) => "1. " (FORMAT NIL "~3,1G" 1.4) => "1. " -20: - from Marco Antoniotti on cmucl-imp mailing list 1 Mar 2000: - (defclass ccc () ()) - (setf (find-class 'ccc1) (find-class 'ccc)) - (defmethod zut ((c ccc1)) 123) - In sbcl-0.7.1.13, this gives an error, - There is no class named CCC1. - In sbcl-0.pre8.20, this works, but prints style warnings about - undefined types. - 27: Sometimes (SB-EXT:QUIT) fails with Argh! maximum interrupt nesting depth (4096) exceeded, exiting diff --git a/NEWS b/NEWS index 93dbf0b..d16f41e 100644 --- a/NEWS +++ b/NEWS @@ -1633,6 +1633,8 @@ changes in sbcl-0.8.0 relative to sbcl-0.7.14 Baumann) * SB-MOP:ENSURE-CLASS-USING-CLASS now takes its arguments in the specified-by-AMOP order of (CLASS NAME &REST ARGS &KEY). + * fixed bug 20: DEFMETHOD can define methods using names that are + not the proper names of classes to designate class specializers. * fixed some bugs revealed by Paul Dietz' test suite: ** COPY-ALIST now signals an error if its argument is a dotted list; diff --git a/src/pcl/boot.lisp b/src/pcl/boot.lisp index 562ff1d..bdb2f18 100644 --- a/src/pcl/boot.lisp +++ b/src/pcl/boot.lisp @@ -588,7 +588,12 @@ bootstrapping. '(ignorable)) (t ;; Otherwise, we can make Python very happy. - `(type ,specializer ,parameter)))) + (let ((type (info :type :kind specializer))) + (ecase type + ((:primitive :defined :instance :forthcoming-defclass-type) + `(type ,specializer ,parameter)) + ((nil) + `(type ,(class-name (find-class specializer)) ,parameter))))))) (defun make-method-lambda-internal (method-lambda &optional env) (unless (and (consp method-lambda) (eq (car method-lambda) 'lambda)) diff --git a/tests/clos.impure.lisp b/tests/clos.impure.lisp index 73a68bb..f0f7cc3 100644 --- a/tests/clos.impure.lisp +++ b/tests/clos.impure.lisp @@ -571,5 +571,14 @@ (make-instance 'class-with-all-slots-missing)) 'setf)) +;;; we should be able to specialize on anything that names a class. +(defclass name-for-class () ()) +(defmethod something-that-specializes ((x name-for-class)) 1) +(setf (find-class 'other-name-for-class) (find-class 'name-for-class)) +(defmethod something-that-specializes ((x other-name-for-class)) 2) +(assert (= (something-that-specializes (make-instance 'name-for-class)) 2)) +(assert (= (something-that-specializes (make-instance 'other-name-for-class)) + 2)) + ;;;; success (sb-ext:quit :unix-status 104) diff --git a/version.lisp-expr b/version.lisp-expr index f701bd9..51d0099 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.26" +"0.pre8.27"