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

Robert Forshaw iouswuoibev at hotmail.com
Sat Jan 10 23:18:53 CET 2004


>From: Noah Gibbs <noah_gibbs at yahoo.com>
>   Actually, it says only that it must be destructed.
>You're recompiling then destructing.  You should
>either change the order of these, or just do the
>destruction, depending on how automatic update works
>in your other functions.

Well I've just taken another look at 
http://phantasmal.sourceforge.net/DGD/Kernel/Inheritance.html and I think I 
have it figured out now. Here's what my function looks like now:

static nomask void recompile(object obj)
{
    if(sizeof(OBJECTD -> query_inheritance_list(obj, INHERITED_BY)))
          destruct_object(obj);
    compile_object(obj);
}

The call to query_inheritance_list() returns an array of the objects that 
inherit the specified object (obj) (the second argument specifies whether to 
return objects that the object inherits or objects that inherit the object). 
This is to check if it is the last object in the inheritance chain. If it 
isn't, it is destructed and recompiled, if it is, then it is just 
recompiled.

_________________________________________________________________
Stay in touch with absent friends - get MSN Messenger 
http://www.msn.co.uk/messenger

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



More information about the DGD mailing list