Changeset 13217


Ignore:
Timestamp:
02/13/11 11:41:56 (7 years ago)
Author:
ehuelsmann
Message:

Move checking for FORWARD-REFERENCED-CLASS superclasses from
FINALIZE-INHERITANCE to COMPUTE-CLASS-PRECEDENCE-LIST, as per
AMOP, which says C-C-P-L should generate an error in such a case.

At the same time, STD-AFTER-INITIALIZATION-FOR-CLASSES doesn't
call FINALIZE-INHERITANCE directly - it generates an error now.

File:
1 edited

Legend:

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

    r13216 r13217  
    434434                #'compute-class-precedence-list)
    435435            class))
    436   (dolist (class (class-precedence-list class))
    437     (when (typep class 'forward-referenced-class)
    438       (return-from std-finalize-inheritance)))
    439436  (setf (class-slots class)
    440437                   (funcall (if (eq (class-of class) +the-standard-class+)
     
    484481(defun std-compute-class-precedence-list (class)
    485482  (let ((classes-to-order (collect-superclasses* class)))
     483    (dolist (super classes-to-order)
     484      (when (typep super 'forward-referenced-class)
     485        (error "Can't compute class precedence list for class ~A ~
     486                which depends on forward referenced class ~A." class super)))
    486487    (topological-sort classes-to-order
    487488                      (remove-duplicates
     
    730731        (add-writer-method class writer (slot-definition-name direct-slot)))))
    731732  (setf (class-direct-default-initargs class) direct-default-initargs)
    732   (funcall (if (eq (class-of class) +the-standard-class+)
    733                #'std-finalize-inheritance
    734                #'finalize-inheritance)
    735            class)
     733  (maybe-finalize-class-subtree class)
    736734  (values))
    737735
     
    785783                            (substitute new-class old-class
    786784                                        (class-direct-superclasses subclass))))
    787                     (finalize-class-subtree new-class)
     785                    (maybe-finalize-class-subtree new-class)
    788786                    new-class))
    789787                 (t
     
    807805
    808806
    809 (defun finalize-class-subtree (class)
     807(defun maybe-finalize-class-subtree (class)
    810808  (when (every #'class-finalized-p (class-direct-superclasses class))
    811809    (finalize-inheritance class)
    812810    (dolist (subclass (class-direct-subclasses class))
    813        (finalize-class-subtree subclass))))
     811       (maybe-finalize-class-subtree subclass))))
    814812
    815813(defmacro defclass (&whole form name direct-superclasses direct-slots &rest options)
Note: See TracChangeset for help on using the changeset viewer.