[DGD] Re: recompile() question

Jason Cone jcone at tamu.edu
Fri Dec 26 04:05:12 CET 1997


>Imagine the following setup:
>
> * object A inherits objects B and C.
> * both B and C inherit D.

[[Rest of message clipped]]

Ok, that totally made sense.  Thanks. :)  I'm beginning to think that what I
want to accomplish isn't really possible.  In fact, I'm 99% sure it isn't...
here's a concrete example:

Object A
========
inherit Object B;

void create()
{
  set_string("This is a test");
}

Object B
========
private string sTestString;

string query_string()
{
  return sTestString;
}

void set_string(string sNewString)
{
  sTestString = sNewString;
}

Ok, so there are our 2 objects.  Simple enough.  It can be assumed that
create() is the function called when the object is loaded by DGD.  So when I
load object A and do Object A -> query_string() I get "This is a test".  So,
without destructing either object, I change the create() function in object
A from set_string("This is a test"); to set_string("Blah");.  If I do
*either* compile_object(Object A) *or* destruct_object(Object B) -
compile_object(Object A) and I do Object A -> query_string() I still get
"This is a test" and not "Blah".


>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');

This would be true were the changed code to be called in respose to an event
(or at another time other than creation).  In the above case, though, it
appears that the "create" function is only called when an object is *first*
compiled.  I guess this is my fundamental question:  Upon compiling an
already-loaded object, is the "create" function called in that object?  Or
is that only reserved for first-time compilation?  I know you can force the
call, but it would make sense to me that DGD would invoke the "create"
function if you compile an already-loaded object that's different than the
existing copy.

Thoughts?  Suggestions?  Counter-examples? :)


||==================================================================||
||                         ||  "Hard work spotlights the character  ||
|| Jason H. Cone           ||   of people:  some turn up their      ||
|| Dept. Computer Science  ||   sleeves, some turn up their noses,  ||
|| Texas A&M University    ||   and some don't turn up at all."     ||
|| jcone at cs.tamu.edu       ||             - Sam Ewing               ||
||                         ||                                       ||
||==================================================================||
||                                             O                    ||
||                                __o         <|\                   ||
||                 ____^o_      _ \<_         _\                    ||
||                             (_)/(_)         /                    ||
||                                                                  ||
||                   JUST        TRI          IT                    ||
||==================================================================||





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



More information about the DGD mailing list