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

Robert Forshaw iouswuoibev at hotmail.com
Sun Jan 11 01:15:58 CET 2004


>From: Bart van Leeuwen <bart at wotf.org>
>Lets go to the example of A inherits B and B inherits C
>
>You changed something in C and try to recompile C.
>This will result in an error if you just call compile_object on it,

Where abouts will the error occur and what will the error message be?

>you will have to dest it and then compile it and you will have to updated 
>code
>active.
>No calls to recompile() will happen (yet)
>
>Now that you got your new code in C active, you want A to inherit the new
>code. To do so, you recompile A by calling compile_object on it.
>
>Before A gets compiled, you will get a call to recompile() with B as its
>argument. recompile() does its work and a NEW B is compiled, which
>inherits the new C. Then A is compiled using the new B
>
>So, in the above example recompile() only gets called on B, and only
>because C was updated.
>
>So, the condition for recompile() to get called is that you have a file
>which itself is inherited, and which inherits an outdated version of
>another library.
>
>To expand on the above example, lets consider A, which inherits B, which
>inherits C, which inherits D. You change D and then upgrade it. Then you
>upgrade A and as a result you get 2 calls to recompile() with B and C as
>their arguments.
>
>I guess the confusion is due to the word recompile being used a bit
>ambigiously throughout docs and conversation :)

I understand now (*cheers*). It would seem though that if I want to update a 
library at the top of the chain (e.g. C in the first example) and have all 
its children updated automatically, I will have to write a lot more code, 
because I have to recompile every object from the bottom upwards in order to 
have them updated! I'm wondering if this is worth doing or whether I should 
do it 'by hand' (i.e. update the individual objects one by one that need 
it). I think a recursive function would be worth another look though if I do 
decide to make it possible to update everything that inherits an object 
automatically.

_________________________________________________________________
Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo

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



More information about the DGD mailing list