[DGD] undefined functions

Kurt Nordstrom doseofvitamink at gmail.com
Thu May 10 14:26:47 CEST 2012


Silent failure for undefined functions is standard DGD/LPC behavior.

If you want the interpreter to complain when calling a non-existent
function, you can override call_other in the master object, I believe.
However, this does require some other tweaking elsewhere because it changes
the calling stack.

I'm fairly certain some folks have done this elsewhere.

-Kurt

On Thu, May 10, 2012 at 3:23 AM, Kent Mein <mein at cs.umn.edu> wrote:

> I've noticed an issue (or at least its an issue for me) with gurbalib
> anyway…
>
> The issue is, if I define some sort of function in the inheritable object
> code,
> say something like this:
>
> int is_wearable(void) {
>   return 1;
> }
>
> and then inside of say the wear command function I typo things like this:
>
> if (obj->is_waerable()) {   // location of the typo
>   obj->do_wear();
> } else {
>    write("You can't wear a " + str + "\n";
> }
>
> Instead of getting an error undefined function call is_waerable, things
> just fail silently.  Is this a tunable parameter in dgd or is this
> something
> we would have to implement at the mud lib level?  (seems like it shouldn't
> be at that level)
>
> I have typechecking    = 2;  in my mud.dgd file.
>
> I'm also willing to work on it, if its something that just needs to be
> done, but I figured I'd ask
> first. :)
>
> Kent
> ___________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
>



-- 
http://www.blar.net/kurt/blog/



More information about the DGD mailing list