Changeset 14343


Ignore:
Timestamp:
12/23/12 16:46:01 (8 years ago)
Author:
Mark Evenson
Message:

Backport r14342 | rschlatte | 2012-12-23 16:19:32 +0100 (Sun, 23 Dec 2012) | 3 lines

Add new slots at the end in inherited classes

  • Fixes #280 (reported by Pascal Costanza)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1.x/src/org/armedbear/lisp/clos.lisp

    r14294 r14343  
    676676
    677677(defun std-compute-slots (class)
    678   (let* ((all-slots (nreverse ;; Slots of base class should come first
    679                      (mapappend #'(lambda (c) (reverse (class-direct-slots c)))
    680                                 (reverse (class-precedence-list class)))))
    681          (all-names (remove-duplicates
    682                      (mapcar 'slot-definition-name all-slots))))
     678  (let* ((all-slots (mapappend #'(lambda (c) (class-direct-slots c))
     679                               ;; Slots of base class must come first
     680                               (reverse (class-precedence-list class))))
     681         (all-names (delete-duplicates
     682                     (mapcar 'slot-definition-name all-slots)
     683                     :from-end t)))
    683684    (mapcar #'(lambda (name)
    684685               (funcall
     
    688689                class
    689690                name
    690                 (remove name all-slots
    691                         :key 'slot-definition-name
    692                         :test-not #'eq)))
     691                ;; Slot of inherited class must override initfunction,
     692                ;; documentation of base class
     693                (nreverse
     694                 (remove name all-slots
     695                         :key 'slot-definition-name
     696                         :test-not #'eq))))
    693697            all-names)))
    694698
Note: See TracChangeset for help on using the changeset viewer.