From: Vladimir Zolotykh
Subject: mixin precedence
Date: 
Message-ID: <opsbzvlpk38k218c@news.eurocom.od.ua>
Would you mind please clarifying the following point?

If I have a mixin class say MY-MIXIN and an ordinary "stand alone"
class MY-CLASS (as opposed to mixin which isn't used alone), when
defining new class say FOO in which order I should specify MY-MIXIN
and MY-CLASS in the superclasses' list? In the simplest case I see no
difference but maybe importance of the order is aroused in some
circumstances? Of course I'm aware of the fact that the position of
the class in the precedence list affects the order of the
applicability of the methods. What I'm seeking for is a kind of a
thumb rule and I vaguely can recall that something like that I've met
before but unfortunately I don't remember what it was about and where.

Thanks in advance

-- 
Vladimir Zolotykh 

From: Kenny Tilton
Subject: Re: mixin precedence
Date: 
Message-ID: <6sOOc.45722$oW6.8986345@twister.nyc.rr.com>
Vladimir Zolotykh wrote:
> 
> Would you mind please clarifying the following point?
> 
> If I have a mixin class say MY-MIXIN and an ordinary "stand alone"
> class MY-CLASS (as opposed to mixin which isn't used alone), when
> defining new class say FOO in which order I should specify MY-MIXIN
> and MY-CLASS in the superclasses' list? In the simplest case I see no
> difference but maybe importance of the order is aroused in some
> circumstances? Of course I'm aware of the fact that the position of
> the class in the precedence list affects the order of the
> applicability of the methods. What I'm seeking for is a kind of a
> thumb rule and I vaguely can recall that something like that I've met
> before but unfortunately I don't remember what it was about and where.

I do not know of the rule of thumb you have in mind. The one I use is to 
use multiple inheritance only with superclasses which do not overlap 
functionally, so the order does not matter. When there is some overlap, 
more specific classes go before less specific, but that is not a rule of 
thumb, that is just necessary given the way the class precedence gets 
built given the superclasses specified to defclass.

kenny

-- 
Cells? Cello? Celtik?: http://www.common-lisp.net/project/cells/
Why Lisp? http://alu.cliki.net/RtL%20Highlight%20Film
From: Vladimir Zolotykh
Subject: Re: mixin precedence
Date: 
Message-ID: <opsb1028je8k218c@news.eurocom.od.ua>
On Sat, 31 Jul 2004 14:58:10 GMT, Kenny Tilton <·······@nyc.rr.com> wrote:

I think you're right, there isn't any rule of thumb I was thinking of
or I mixed it up with something else. The only thing that worth
mentioninig in this regard is that the mixin class should come before
the classes from the main inheritance trunk. At least it was so in my
particular case which has inspired me to ask that silly question.

-- 
Vladimir Zolotykh 
From: Thomas Schilling
Subject: Re: mixin precedence
Date: 
Message-ID: <opsb0dfndftrs3c0@news.CIS.DFN.DE>
Vladimir Zolotykh wrote:

> If I have a mixin class say MY-MIXIN and an ordinary "stand alone"
> class MY-CLASS (as opposed to mixin which isn't used alone), when
> defining new class say FOO in which order I should specify MY-MIXIN
> and MY-CLASS in the superclasses' list? In the simplest case I see no
> difference but maybe importance of the order is aroused in some
> circumstances? Of course I'm aware of the fact that the position of
> the class in the precedence list affects the order of the
> applicability of the methods. What I'm seeking for is a kind of a
> thumb rule and I vaguely can recall that something like that I've met
> before but unfortunately I don't remember what it was about and where.

Maybe this helps?

   http://www.psg.com/~dlamkins/sl/chapter14.html

See section

  "Object inheritance matters after all; finding the applicable method"

-- 
      ,,
     \../   /  <<< The LISP Effect
    |_\\ _==__
__ | |bb|   | _________________________________________________