Can LDMud warn when calling undefined functions in other obs?

31 views
Skip to first unread message

William Edsall

unread,
Dec 8, 2024, 1:26:07 PM12/8/24
to LDMud Talk
I'm hoping there is a built-in way to tell LDMud to throw an error or warning when an object calls an undefined function in another object. The goal is simply to identify that the function is missing or perhaps was typoed.

Thanks
William

Gnomi

unread,
Dec 8, 2024, 2:05:55 PM12/8/24
to ldmud...@googlegroups.com
Hi William,

William Edsall wrote:
> I'm hoping there is a built-in way to tell LDMud to throw an error or
> warning when an object calls an undefined function in another object.

There is a driver hook H_DEFAULT_METHOD, that is called when
call_other()/call_resolved()/call_strict()/call_out() couldn't find the
method.

With best regards,
Gnomi

Stephan Weinberger

unread,
Dec 8, 2024, 10:43:00 PM12/8/24
to ldmud...@googlegroups.com
Have a look at call_strict() or call_direct_strict().


Maybe we should add a manpage comparing all the variants of call_xxx()
in a simple table.


cya,

  Invis

Daniel McCarney

unread,
Dec 10, 2024, 6:09:30 AM12/10/24
to ldmud...@googlegroups.com
Hi William,

There might be other approaches but one idea would be to implement your own H_DEFAULT_METHOD hook to do the warning/runtime err: 
https://github.com/ldmud/ldmud/blob/74503aaa72f874e311040097968d2c4efe6df0fb/doc/concepts/hooks#L50-L52

Best of luck,

--
You received this message because you are subscribed to the Google Groups "LDMud Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ldmud-talk+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ldmud-talk/e6dd3715-bcbb-4f71-bfd4-cd677567aae7n%40googlegroups.com.

William Edsall

unread,
Dec 11, 2024, 7:56:48 PM12/11/24
to LDMud Talk
The H_DEFAULT_METHOD worked well. I'm porting over a bunch of code from a C project to LPC, so it's helpful to sanity check and see what functions I missed.

Thanks for the guidance
William
Reply all
Reply to author
Forward
0 new messages