[DGD] static creator function not called on cloned objects?

Troels Therkelsen troels at 2-10.org
Fri Oct 19 20:09:19 CEST 2001


I have object /core/obj/a.c:

#define DRIVER "/core/driver"

static void create() { DRIVER->stderr("create
"+object_name(this_object())); }

In the driver object I have:

void stderr(string msg) {
  send_message(msg+"\n");
}

static void initialize() {
  object a, b;

  stderr(object_name(a = compile_object("/core/obj/a")));
  call_other(a, "???");
  stderr(object_name(b = clone_object(a)));
  call_other(b, "???");
  shutdown();
}

I have the creator function defined in the runtime config to "create".
I use DGD version 1.2.31.

The behaviour I don't understand is that I can clearly see the create()
function called in the master object of a, but it's not called in the
clone if it's defined static.  If I remove the static from the create(),
then it's called in both the master and clone.

I thought the backbone was always allowed to call static functions?
Even if this is so, it still puzzles me that master and clone objects
do not behave consistently on this.

Bug or feature? :-)

Regards,

/Troels Therkelsen

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



More information about the DGD mailing list