Changeset 13214


Ignore:
Timestamp:
02/12/11 18:10:07 (11 years ago)
Author:
ehuelsmann
Message:

Finalize subclasses as soon as a forward-referenced class gets defined
(and itself can be finalized).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/clos.lisp

    r13210 r13214  
    785785                            (substitute new-class old-class
    786786                                        (class-direct-superclasses subclass))))
     787                    (finalize-class-subtree new-class)
    787788                    new-class))
    788789                 (t
     
    804805             (%set-find-class name class)
    805806             class)))))
     807
     808
     809(defun finalize-class-subtree (class)
     810  (when (every #'class-finalized-p (class-direct-superclasses class))
     811    (finalize-inheritance class)
     812    (dolist (subclass (class-direct-subclasses class))
     813       (finalize-class-subtree subclass))))
    806814
    807815(defmacro defclass (&whole form name direct-superclasses direct-slots &rest options)
     
    25782586                        (compute-applicable-methods gf args))
    25792587                    gf-list)))
    2580           (slots (class-slots (class-of instance))))
     2588    (slots (class-slots (class-of instance))))
    25812589      (do* ((tail initargs (cddr tail))
    25822590            (initarg (car tail) (car tail)))
    25832591           ((null tail))
    25842592        (unless (or (valid-initarg-p initarg slots)
    2585                     (valid-methodarg-p initarg methods)
     2593        (valid-methodarg-p initarg methods)
    25862594                    (eq initarg :allow-other-keys))
    25872595          (error 'program-error
     
    26622670  ;; checking initarg validity
    26632671  (do* ((tail all-keys (cddr tail))
    2664         (initarg (car tail) (car tail)))
     2672  (initarg (car tail) (car tail)))
    26652673      ((null tail))
    26662674    (unless (symbolp initarg)
    26672675      (error 'program-error
    2668              :format-control "Invalid initarg ~S."
    2669              :format-arguments (list initarg))))
     2676       :format-control "Invalid initarg ~S."
     2677       :format-arguments (list initarg))))
    26702678  (dolist (slot (class-slots (class-of instance)))
    26712679    (let ((slot-name (slot-definition-name slot)))
Note: See TracChangeset for help on using the changeset viewer.