[DGD] Re: recompile() question
harte at xs4all.nl
harte at xs4all.nl
Thu Dec 25 10:33:07 CET 1997
Quoting Jason's message from 24 Dec:
| Greetings.
Hi. :)
| I'm having a visualization problem with how and when the recompile()
| function is called in the driver object.
Imagine the following setup:
* object A inherits objects B and C.
* both B and C inherit D.
Now destruct object D and B, and compile both of them again. Now you
have two different versions of D, one used by B, the other used by C.
It is my understanding that if you would now either 'destruct + compile'
or 'recompile' A, recompile_object() will be called with object C,
because that one is still inheriting an already destructed object (the
original version of D).
If you do not destruct it, you'll run into an error about inheriting
different versions of the same object. If you -do- destruct it, the
inherit_program() will be called in the driver object for C that can
then use the newer version of D, after which A can again inherit it.
So the bottomline seems to be that recompile_object() is called when
you're trying to inherit an object that in turn depends on an already
destructed object.
<< So, how far off was I, Dworkin? *grin* :) >>
[...]
| Object A inherits object B. Object A sets a string variable in object B via
| a "set" function that is later queried by other objects. I load object A.
| I change the value in the "set" function in object A.
|
| Now, it's my understanding that compile_object() can be used on
| already-loaded objects and will replace the loaded one with the newer one.
| I'm currently solving the above scenario by destructing object A and then
| reloading it. There are a few cases where this is not desirable, however.
| And I can not, for the life of me, get recompile() to be called in the
| driver object no matter how I compile/destruct/etc object A. I tried
| compile_object() on object B, but it gave me the expected error of trying to
| recompile an inherited object.
So you want to change something in B and see that change reflected in A
without having to destruct A? Then you need to do this:
destruct_object(`Object B');
compile_object(`Object A');
If all you want is see a change in the LPC code of A made effective,
then you can suffice with:
compile_object(`Object A');
[...]
| Gracias,
|
| Jason Cone
Hope this helps a bit.
Erwin.
--
Erwin Harte - Programmer : Unix is an operating system, OS/2 is
: half an operating system, Windows is a
Email: harte @ xs4all.nl : shell, and Dos is a boot partition virus
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list