Update of /cvsroot/sbcl/sbcl/src/pcl
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv10460/src/pcl
Modified Files:
slots-boot.lisp std-class.lisp
Log Message:
1.0.7.36: FIND-SLOT-DEFINITION to return NIL when called with non-slot-classes
* Add a default method to CLASS-SLOT-VECTOR that returns #(NIL), restoring
the pre-1.0.7.26 behaviour of calling SLOT-MISSING when trying to access
slots in non-SLOT-CLASS instances.
* Add a slightly dubious test-case.
Index: slots-boot.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/pcl/slots-boot.lisp,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- slots-boot.lisp 17 Jul 2007 20:50:20 -0000 1.34
+++ slots-boot.lisp 21 Jul 2007 01:55:42 -0000 1.35
@@ -551,7 +551,7 @@
;;; empty vector separately: it just returns a NIL.
(defun find-slot-definition (class slot-name)
- (declare (symbol slot-name) (inline getf))
+ (declare (symbol slot-name))
(let* ((vector (class-slot-vector class))
(index (rem (sxhash slot-name) (length vector))))
(declare (simple-vector vector) (index index)
Index: std-class.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/pcl/std-class.lisp,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -d -r1.112 -r1.113
--- std-class.lisp 17 Jul 2007 18:36:34 -0000 1.112
+++ std-class.lisp 21 Jul 2007 01:55:42 -0000 1.113
@@ -1557,6 +1557,11 @@
(def class-direct-default-initargs)
(def class-default-initargs))
+(defmethod class-slot-vector (class)
+ ;; Default method to cause FIND-SLOT-DEFINITION return NIL for all
+ ;; non SLOT-CLASS classes.
+ #(nil))
+
(defmethod validate-superclass ((c class) (s built-in-class))
(or (eq s *the-class-t*) (eq s *the-class-stream*)
;; FIXME: bad things happen if someone tries to mix in both
|