Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dylan question (OT, sorry)

4 views
Skip to first unread message

Didier Verna

unread,
Jun 17, 2008, 9:23:33 AM6/17/08
to

Hi !

I'm posting this on comp.lang.lisp as well because my usenet provider
doesn't have any news in comp.lang.dylan, so I suspect something is
rotten in the state of Denmark...

Consider this:

define class <mymix> ()
end class <mymix>;

define class <mysuper> (<mymix>)
end class <mysuper>;

define class <myclass> (<mymix>, <mysuper>)
end class <myclass>;

define method foobar (obj :: <mymix>)
format-out("MyMix method.\n");
end method foobar;

define method foobar (obj :: <mysuper>)
format-out("MySuper method.\n");
end method foobar;

define function main(name, arguments)
let myobject = make (<myclass>);
foobar (myobject);
exit-application(0);
end function main;


If it were common lisp code, this wouldn't compile because the class
precedence order can't be computed. Not surprising. Now, with opendylan
(1.0b4), this triggers a "serious warning" but compiles fine.

The foobar method actually called is the mymix one, which is puzzling to
me. But then, if I remove the method specialized on mymix, I get both a
serious warning and a run-time error stating that myobject is not of
class mysuper. This suggests that the compiler effectively removed
mysuper from the (multiple-)inheritance graph of myclass. ?!?!

Can somebody enlighten me ?

Thanks.

--
5th European Lisp Workshop at ECOOP 2008, July 7: http://elw.bknr.net/2008/

Didier Verna, did...@lrde.epita.fr, http://www.lrde.epita.fr/~didier

EPITA / LRDE, 14-16 rue Voltaire Tel.+33 (0)1 44 08 01 85
94276 Le Kremlin-Bicętre, France Fax.+33 (0)1 53 14 59 22 did...@xemacs.org

Ralf Mattes

unread,
Jun 17, 2008, 10:51:39 AM6/17/08
to

Didier Verna

unread,
Jun 18, 2008, 4:03:01 AM6/18/08
to
0 new messages