[armedbear-cvs] r14342 - trunk/abcl/src/org/armedbear/lisp
rschlatte at common-lisp.net
rschlatte at common-lisp.net
Sun Dec 23 15:19:34 UTC 2012
Author: rschlatte
Date: Sun Dec 23 07:19:32 2012
New Revision: 14342
Log:
Add new slots at the end in inherited classes
- Fixes #280 (reported by Pascal Costanza)
Modified:
trunk/abcl/src/org/armedbear/lisp/clos.lisp
Modified: trunk/abcl/src/org/armedbear/lisp/clos.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/clos.lisp Wed Dec 19 02:00:36 2012 (r14341)
+++ trunk/abcl/src/org/armedbear/lisp/clos.lisp Sun Dec 23 07:19:32 2012 (r14342)
@@ -675,11 +675,12 @@
;;; Slot inheritance
(defun std-compute-slots (class)
- (let* ((all-slots (nreverse ;; Slots of base class should come first
- (mapappend #'(lambda (c) (reverse (class-direct-slots c)))
- (reverse (class-precedence-list class)))))
- (all-names (remove-duplicates
- (mapcar 'slot-definition-name all-slots))))
+ (let* ((all-slots (mapappend #'(lambda (c) (class-direct-slots c))
+ ;; Slots of base class must come first
+ (reverse (class-precedence-list class))))
+ (all-names (delete-duplicates
+ (mapcar 'slot-definition-name all-slots)
+ :from-end t)))
(mapcar #'(lambda (name)
(funcall
(if (eq (class-of class) +the-standard-class+)
@@ -687,9 +688,12 @@
#'compute-effective-slot-definition)
class
name
- (remove name all-slots
- :key 'slot-definition-name
- :test-not #'eq)))
+ ;; Slot of inherited class must override initfunction,
+ ;; documentation of base class
+ (nreverse
+ (remove name all-slots
+ :key 'slot-definition-name
+ :test-not #'eq))))
all-names)))
(defun std-compute-effective-slot-definition (class name direct-slots)
More information about the armedbear-cvs
mailing list