[DGD] Recursion in recompile(), is this correct?
Bart van Leeuwen
bart at wotf.org
Sat Jan 10 23:58:38 CET 2004
On Sat, 10 Jan 2004, Noah Gibbs wrote:
> --- Robert Forshaw <iouswuoibev at hotmail.com> wrote:
> > If this is true then it's very strange behaviour!
>
> DGD mostly lets you do your own recompile behavior.
> We consider that a feature around here. At least, I
> definitely do. But it means that there are a lot of
> standard cases where a recompile would be reasonable
> that DGD gives you no notification of that fact... It
> just tells you what actually happened and lets you
> figure out that it's time for a recompile.
>
> Bart mentioned the case where you recompile a
> library and DGD doesn't notify all the children.
> That's a good example. It's because DGD gives *you*
> the ability to track the children, and you can notify
> them yourself, if you care.
>
> This takes more code. However, the code is already
> out there (mine, Geir Harald Hansen's). Anybody who
> complains that DGD requires too much code to do this,
> then refuses to use somebody's pre-written version,
> gets about the amount of sympathy they deserve :-)
>
> > I
> > don't see how it would
> > cause an error though.
>
> The object you're recompiling has child objects. So
> unless your version of destruct_object() knows that
> and destructs it before recompiling, you get an error.
> That's because you can't directly recompile an object
> with child objects. You have to destruct it first.
>
> There's another example of a case where you'd like
> to have an object manager tracking this stuff :-)
Of course you could just catch the error and respond to it.. actually,
the frontend to the compiler that coders use on my mud calls itself with
an extra flag to dest the library when running into that situation.. I
don't like handling it on the level of the auto or driver objects, it
can be 'automatic' in a tool, but it should normally not occur without
a wizard triggering the recompile and I want to see a failure when it
occurs 'spontaneously' ;P
Anyway.... the check as Robert has it is not needed I think.. I have never
gotten calls to recompile() unless they are needed because the object
happens to be inherited.
So.. normally your recompile() function would just destroy the library it
gets passed and not do anything else, unless you want to do what me and
later Noah described, notify all objects that inherit the library so they
can decide to recompile themselves as well (this can get rather funny when
you update a real low level library that is used all over the place ;)
Bart
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list