Apparant STklos class precedence problem

From: David Fox <fox_at_first.cs.nyu.edu>
Date: Fri, 11 Nov 94 17:41:01 -0500

I have a class heirarchy resembling the following:

  (define-class <a> () ())
  (define-class <b> () ())
  (define-class <c> (<b>) ())
  (define-class <d> (<c> <a>) ())

  (define-method m ((self <a>)) (display "I'm an <a>") (newline))
  (define-method m ((self <b>)) (display "I'm a <b>") (newline))

Now if I create a <c> and a <d> and pass them to m:

  (m (make <c>))
  (m (make <d>))

I see

  I'm a <b>
  I'm an <a>

It seems to me that d should be a <b>, because <c> comes before <a>
in the definition of <d>, and <b> should come before <a> because CLOS
is supposed to keep the <c> family tree together. Isn't this right?
Received on Fri Nov 11 1994 - 23:41:58 CET

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST