[DGD] Re: Inheritance create()

Erwin Harte harte at is-here.com
Thu Mar 18 22:38:38 CET 2004


On Thu, Mar 18, 2004 at 04:17:42PM -0500, Michael McKiel wrote:
> I wrote a lengthy mail, desribing how my tree et al looked like, but after I
> reread it, it was more of a design discussion - and likely not overly of
> interest. I wound up taking the inherit API_USER out of the user object
> itself. Since as I perused the code, it didn't require direct access to the
> userd.c - that's handled in the command-bin and wiztool.
> 
> But I have a new problem that I thought named inheritance prevented...
> (I've patched up to 1.2.82)
> 
> in my user.c object I have:
> 
> # define NEW_INHERIT_MESSAGE
> 
> # ifdef NEW_INHERIT_MESSAGE
> inherit kuser LIB_USER;
> inherit thing LIB_THING;
> # else
> inherit LIB_USER;			/* Kernel User LIB	*/
> inherit LIB_THING_USER;		/* Ahhh the Thing the Thing 	*/
> # endif
> 
> and when I try to startup the driver I get:
> 
> /object/secure/user.c, 499: inherited multiple instances of:
> /object/secure/user.c, 499:   message (/inherit/common/thing,
>                                        /inherit/kernel/user)
> 
> Nothing that LIB_THING inherits has a message(), just itself.
> 
> So I thought the main use of named inheritance was to allow a given object to
> inherit multiple instances of a similiar named function?

And then let the inheriting program decide which one to use, if any,
or even both if that is the most appropriate way to deal with it.

For instance:

  int message(string str)
  {
      return thing::message(str);
  }

Erwin.
-- 
Erwin Harte <harte at is-here.com>
_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list