[598] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next last

Re: Another inheritance question.

daemon@ATHENA.MIT.EDU (Sat Nov 26 16:41:37 1994 )

From: deforest@netcom.com (Robert de Forest)
To: jeffpk@netcom.com (Jeff Kesselman)
Date: Sat, 26 Nov 1994 13:31:06 -0800 (PST)
Cc: coldstuff@MIT.EDU
In-Reply-To: <199411260120.RAA01363@netcom5.netcom.com> from "Jeff Kesselman" at Nov 25, 94 05:20:09 pm

> 
> Okay. My first one seemed so easy to you all, here's another one....
> 
> 
> Object A
>    defines foo which contains a 'pass' function call
> 
> Object B
>   is a child of Object A
> 
> Object C
>   is a child of Object A
> 
> Obejct D
>   is a child of Obejct B and Object C
>   defines foo which contains a 'pass' function call.
> 
> How many copies of Object A's data fields end up in Object D, and how many 
> times will D.foo() call A.foo() ?
> 
> Thanks again,
> 
> Jeff Kesselman
> 
> 

I believe the manual answers all this. Also, it is easy enough to test this on
 a running server. I will try to answer your questions anyway.

D.foo() will call A.foo() once, and A.foo() will try to call the .foo() on
 its parents if one exists, or will throw ~methodnf if not.

D.foo will have NO copies of A's data fields, but WILL have parameters
 associated with A which A.foo, but not D.foo can manipulate.

As an example, if you have $vr_object with parameter 'vr_owner, a child of
 $vr_object called $located and a child of $vr_object called $location, and
 a child of $located and $location called $thing, then $thing will have one
 'vr_owner parameter associated with the parent $vr_object.

I am not sure what happens when all of the above objects have a .info method
 and they all pass(). Could someone try this and post it, or Could Greg tell
 us and also why he chose this way? (I'm curious since I don't know and such.)

Crag / Robert