[DGD]varargs void foo(object bar)

Felix A. Croes felix at dworkin.nl
Wed Dec 2 15:03:51 CET 1998


Adam David <adam at veda.is> wrote:

> > Yes.  Note that my drive to radically clean up the LPC language and
> > release DGD 2.0 is not that large, considering that it would break
> > backward compatibility (having all those muds running DGD is a
> > great asset even just for testing out my code).  For 1.2 I plan
> > to add multiprocessor support + full LPC documentation, and I can
> > vaguely foresee a 1.3 with bugfixes and new platform ports, so
> > 2.0 would be at least several years in the future.  I'd much rather
> > concentrate on writing a good mudlib.
>
> Sounds good. How about parallel development of 1.x and 2.x though,
> in order to better prepare the new ground?

The same reason applies -- I am not that eager to start on a new
mud server which essentially has to gain support from scratch again.
At this point I'd rather be working on a mud than on a mud server.


>[...]
> > I know of only one good argument against multiple inheritance.
>
> Would you like to briefly state it or point to it?

Suppose you have an inheritable sword object and an inheritable
armour object.  Both object inherit the generic mud object, and
both objects modify the move() function in the following fashion:

weapon.c:

    void move(object destination)
    {
	if (wielded) {
	    write("You drop your wielded weapon.\n");
	    wielded = 0;
	}
	::move(destination);
    }

armour.c:

    void move(object destination)
    {
	if (worn) {
	    write("You remove your worn armour.\n");
	    worn = 0;
	}
	::move(destination);
    }

Now if you make a new object that inherits both weapon and armour,
redefining move() and calling weapon::move() and armour::move()
will move the object to the destination twice.

There are many ways around it, but in one way or another you
lose the desirable ability to modify the behaviour of (some)
inherited functions by redeclaring them and calling the inherited
function from the redeclared one.

Regards,
Dworkin



More information about the DGD mailing list