[DGD] Recursion in recompile(), is this correct?

Robert Forshaw iouswuoibev at hotmail.com
Sat Jan 10 21:31:25 CET 2004


I am trying to implent the automatic updating of inherited objects using the 
recompile() function call. I am wondering whether it is necessary to call a 
recursive function such as I have in order to achieve a recompile of all 
objects in the list, or whether recompile() is called again automatically? 
Here is my code:

static nomask void recompile(object obj)
{ /* If an object A is loaded, A inherits B, B inherits C, and the version
     of C inherited by B is out of date, recompile(B) will be called in
     the driver object. If B should actually be recompiled (inheriting the
     new version of C from B), the driver object must destruct B; if this
     is done, A will inherit the most recent versions of B and C. */

    string * inheritance;
    int size, count;

    inheritance = OBJECTD -> query_inheritance_list(obj, INHERITED_BY);
    size = sizeof(inheritance);

    compile_object(obj);
    destruct_object(obj);

    for(count = 0; count < size; count++)
      {
          recompile(inheritance[count]);
      }
}


The query_inheritance_list() function call retrieves a list of objects that 
inherit the specified object (obj in this case). I don't think the rest 
needs explaining. So, am I doing this correct? If not, how should I do it? 
I'm not in a position to test it just yet because of the state of the rest 
of the lib, so that's why I'm hoping someone can help me.

_________________________________________________________________
Use MSN Messenger to send music and pics to your friends 
http://www.msn.co.uk/messenger

_________________________________________________________________
List config page:  http://list.imaginary.com/mailman/listinfo/dgd



More information about the DGD mailing list