Re: call-next-method invocation order
Jan Moringen <[email protected]> Mon, 19 Jul 2010 01:16:27 +0200
| Newsgroups | gmane.emacs.eieio |
|---|---|
| Message-ID | <7732_1279501658_ZZh040c0zIkaB.00_1279494987.2384.30.camel@steed.robot-madness> |
Hi Frank. > I'm not sure maybe there's a problem with (call-next-method)'s > invocation order with multiple inheritance; > > Check this tree out > > +--base > +--derived1 > | +--derived2 > | +--derived3 > +--derivedX > +--derived3 > > And here's the code for it; > Well it's kinda a complex example but the point why I bother you guys > with it is if I run this example on Allegro CL I get a different result; > BTW if I add :method-invocation-order :depth-first to class derived2 I > get the same result as on Allegro CL; EIEIO has three linearization methods: depth-first, breadth-first and c3 (see [1]). The default is breadth-first search which can reach base before derived1, as your td2 example shows, since paths from derived3 have length 2 in both cases. The method used in CLOS (and therefore probably in Allegro CL) is different from all three and also described in [1]. In many cases, even complex hierarchies, the c3 linearization mentioned in [1] does the right thing. Your example should work with c3 linearization. It can be used in EIEIO with :method-invocation-order :c3. > As I'm not an expert in CL I'll leave it up to you guys what to do with it; Maybe the documentation can be improved. Kind regards, Jan [1] http://192.220.96.201/dylan/linearization-oopsla96.html ------------------------------------------------------------------------------ This SF.net email is sponsored by Sprint What will you do first with EVO, the first 4G phone? Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first