[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CPL anxieties

(defclass Animate-things (. . . ) ())		  ;has possibly many suprs
(defclass Colored-things (. . . ) ())		  ;has possibly many suprs also
(defclass Turtles (Animate-things) ())
(defclass Green-things (Colored-things) ())
(defclass Green-turtles (Turtles Green-things) ())

		     .                      .
	     Animate-things                 . 
	       blush-method  = turn-pink    . 
		 |                          .
		 |	      Colored-things
		 |	        noseup-method = become-haughty
		 |		             |
   Turtles                           Green-things
     noseup-method = pick-up-pen       blush-method = turn-purple
              \                      /
                \                  /
                  \              /
    I presume everyone can see the conflict which will arise if the
    two  direct supers to Green-turtles don't directly follow the class
    itself. One way to view this situation is that Green-turtles is a
    contradictory class, because it would inherit, say, a blush-method
    from two distinct suprs -- from Green-things and from
    Animate-things.  Another view is that the present methods of the
    direct suprs are "more important and shadow any "higher" up.  A
    third view is that the user ought to be able to distinguish such
    situations in his program in a simple way.

    If you are of the first opinion, then a good question to ask
    yourself is "Why does the conflict go away when I merge the class
    Colored-things  into the class Animate-things?  Should it?"

If the currently proposed algorithm is used, you will not be able to see
the difference between merging turtle and animate-thing, and/or merging
gren and colored things.  The order proposed puts both turtle and
animate before both green and colored, so the latter two will have no
effect wrt the two methods of concern.  I claim this is correct.

The CPL algorithm as I now undertand it preserves:

1) subclasses go before superclasses
2) local precedence order is preserved
3) if two sublattices from two classes that have have no members in
common, then all members of one sublattice occur before all the members
of the other.  This preserves the invariant that a program should not
change if you just split the functionality of a class into any number of