[DGD] Recursion in recompile(), is this correct?
Bart van Leeuwen
bart at wotf.org
Sat Jan 10 22:24:47 CET 2004
On Sat, 10 Jan 2004, Robert Forshaw wrote:
> >From: Noah Gibbs <noah_gibbs at yahoo.com>
> > Since whether this works depends on how you call it,
> >we don't really have enough information to go on here.
> > More to the point, we don't really want to verify a
> >bunch of code that hasn't been tested.
>
> Perhaps you don't. That's not what I was asking. I just want to know if a
> recursive call is necessary in order to update every object in the
> inheritance hierarchy.
For what I have seen, no, the driver will do this for you.
>
> > With that said: I note that you are *always*
> >destructing the object, regardless of how the
> >recompile goes. That's not what your comment says.
>
> That's not my comment, it was from the docs.
>
> >So at the very least, your code and your comments
> >disagree. It also seems a bit silly to bother
> >compiling the object if you're just going to destruct
> >it.
>
> It is supposed to destruct the old copy. The obj variable holds a pointer to
> the old version of the object, which is what gets destructed, and the
> recompiled version doesn't have a pointer. At least, that is what I thought.
>
> >Also: since your recompile() function calls itself,
> >it's a bit much to call it on every item in the list.
> >That means that any common parent classes (like,
> >inherited by more than one parent of your object) will
> >get recompile called on them repeatedly, which is
> >wasteful, at least the way you've coded it.
> >
> > Also, you're recompiling the parent before
> >destructing it. I think that you can't directly
> >recompile an object if it has children. I think you
> >get an error. Maybe that's just the Kernel Lib,
> >though.
>
> According to the comment (which is from /doc/Introduction in the
> distribution) this is not the case:
> ("If B should actually be recompiled (inheriting the new version of C from
> B), the driver object must destruct B"). Did I misinterpret that?
Correct, you get an error if you try to just compile such an object so you
have to dest it to get the new code compiled.
>
> _________________________________________________________________
> It's fast, it's easy and it's free. Get MSN Messenger today!
> http://www.msn.co.uk/messenger
>
> _________________________________________________________________
> List config page: http://list.imaginary.com/mailman/listinfo/dgd
>
_________________________________________________________________
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list