[DGD] Re: Possible bug in DGD 1.1?
Par Winzell
zell at alyx.com
Wed Jun 3 02:01:55 CEST 1998
> The problem, succinctly, is that I appear to be unable to make
> a call_out to a static function. My auto object has the two
> following functions (heavy snippage applied):
>
> void set_heart_beat (int time) {
> heart_beat_handle=call_out("do_heart_beat",time) ;
> write ("HBH is "+heart_beat_handle+"\n") ;
> }
>
> static void do_heart_beat() {
> get_object(ME)->catch_tell("foo") ;
> err = catch(this_object()->heart_beat()) ;
> heart_beat_handle = call_out("do_heart_beat",heart_beat_time) ;
> }
Somebody more knowledgeable than me will surely respond, but since
nobody has yet -- with the proper disclaimers -- as I understand it,
static functions in the auto object are treated differently from ones
defined elsewhere. They are seen as kfuns, meaning you can't call them
using a this_object()->foo(); kind of deal, which you normally can. It
seems to me that that is what call_out() eventually does.
>From sneaked looks at other auto objects using call_out, I believe you
can accomplish the security check with:
void set_heart_beat (int time) {
heart_beat_handle=call_out("do_heart_beat",time) ;
write ("HBH is "+heart_beat_handle+"\n") ;
}
void do_heart_beat() {
if (previous_program()) return; /* tadaa */
get_object(ME)->catch_tell("foo") ;
err = catch(this_object()->heart_beat()) ;
heart_beat_handle = call_out("do_heart_beat",heart_beat_time) ;
}
Hope that does it. Hope I'm right.
Zell
List config page: http://list.imaginary.com/mailman/listinfo/dgd
More information about the DGD
mailing list