Updated 2012-10-15 08:56:40 by dkf

Utility function in the Tcl library that generates the standard 'wrong # args' messages. From 8.5 onwards, it is aware of the chain of rewrites done by interp alias and namespace ensemble on the route from what the user typed to the point where the message is generated so that it can generate a sensible error message.

Typical Use edit

int myCommandImplementation(
    ClientData clientData, Tcl_Interp *interp,
    int objc, Tcl_Obj *const objv[])
{
    if (objc != 3) { /* two arguments, plus command name */
        Tcl_WrongNumArgs(interp, 1, objv, "fooArg barArg");
        return TCL_ERROR;
    }
    /* The rest of the command implementation... */
}

Frequently used with Tcl_GetIndexFromObj; T_WNA can use information provided through T_GIFO for better error message generation..