From: Eugene J Koontz

Subject: cyclic dependency error while using CLOS

Date: 1998-4-8 18:41

Doing the following :

(defclass t1 nil nil)
(defclass t2 nil nil)
(defclass t3 nil nil)
(defclass t4 (t1) nil)
(defclass t5 (t1 t2) nil)
(defclass t6 (t3 t4) nil)
(defclass t7 (t2 t3) nil)
(defclass t8 (t6 t5 t7) nil)

and then finally  :

(make-instance 't8)


causes the error :

Error: While computing the class precedence list of the class named T8.
It is not possible to compute the class precedence list because
there is a circularity in the local precedence relations.
This arises because:
  the class named T3 follows the class named T2 in the supers of the
class named T7
  the class named T4 follows the class named T3 in the supers of the
class named T6
  the class named T1 appears in the supers of the class named T4
  the class named T2 follows the class named T1 in the supers of the
class named T5.
  [condition type: PROGRAM-ERROR]


One way is to substitute (defclass t6 (t4 t3) nil) for (defclass t6 (t3
t4) nil), however this seems to require detecting cycles before doing
any defclass, and this is costly in terms of time. Is there any other
way around this problem?

-- 
 ___________________________________________________________
 Eugene J. Koontz                       Center of Excellence  
 <cedar.buffalo.edu at ekoontz>          in Document Analysis and
 http://www.cs.buffalo.edu/~ekoontz      Recognition-(CEDAR)