Index: generic/asm/nsfAssemble.c =================================================================== diff -u -r2dca7abdd5d83421b31b220bc6dabba1047d68fb -r1c21a6f9ab7fe20490ba256cb8cf3759b8498838 --- generic/asm/nsfAssemble.c (.../nsfAssemble.c) (revision 2dca7abdd5d83421b31b220bc6dabba1047d68fb) +++ generic/asm/nsfAssemble.c (.../nsfAssemble.c) (revision 1c21a6f9ab7fe20490ba256cb8cf3759b8498838) @@ -70,6 +70,7 @@ AsmCompiledProc *proc; NsfParamDefs *paramDefs; int with_ad; + int with_checkAlways; } AsmProcClientData; typedef struct AsmResolverInfo { @@ -401,7 +402,8 @@ static int NsfAsmProcAddArgs(Tcl_Interp *interp, Tcl_Obj *argumentsObj, - Tcl_Obj *nameObj, Tcl_Obj *bodyObj, int with_ad) { + Tcl_Obj *nameObj, Tcl_Obj *bodyObj, + int with_ad, int with_checkAlways) { int argc, result; Tcl_Obj **argv; AsmCompiledProc *asmProc; @@ -422,6 +424,7 @@ cd->proc = asmProc; cd->paramDefs = NULL; cd->with_ad = with_ad; + cd->with_checkAlways = with_checkAlways ? NSF_ARGPARSE_CHECK : 0; Tcl_CreateObjCommand(interp, procName, NsfAsmProc, cd, NsfAsmProcDeleteProc); Index: generic/nsf.c =================================================================== diff -u -r14101af0c3253e79cf68622cb05e51eb780e1f39 -r1c21a6f9ab7fe20490ba256cb8cf3759b8498838 --- generic/nsf.c (.../nsf.c) (revision 14101af0c3253e79cf68622cb05e51eb780e1f39) +++ generic/nsf.c (.../nsf.c) (revision 1c21a6f9ab7fe20490ba256cb8cf3759b8498838) @@ -13188,7 +13188,7 @@ /* If the argument parsing is ok, the shadowed proc will be called */ result = ProcessMethodArguments(pcPtr, interp, NULL, - NSF_ARGPARSE_FORCE_REQUIRED, + tcd->with_checkAlways|NSF_ARGPARSE_FORCE_REQUIRED, tcd->paramDefs, objv[0], objc, tov); @@ -13238,7 +13238,8 @@ */ static int NsfProcAdd(Tcl_Interp *interp, NsfParsedParam *parsedParamPtr, - CONST char *procName, Tcl_Obj *body, int with_ad) { + CONST char *procName, Tcl_Obj *body, + int with_ad, int with_checkAlways) { NsfParamDefs *paramDefs = parsedParamPtr->paramDefs; Tcl_Namespace *cmdNsPtr; NsfProcClientData *tcd; @@ -13313,6 +13314,7 @@ tcd->procName = procNameObj; tcd->paramDefs = paramDefs; tcd->with_ad = with_ad; + tcd->with_checkAlways = with_checkAlways ? NSF_ARGPARSE_CHECK : 0; tcd->cmd = NULL; /*fprintf(stderr, "NsfProcAdd %s tcd %p paramdefs %p\n", @@ -19223,20 +19225,21 @@ /* cmd asmproc NsfAsmProcCmd { - {-argName "-ad" -required 0} + {-argName "-ad" -required 0 -nrargs 0 -type switch} + {-argName "-checkalways" -required 0 -nrargs 0 -type switch} {-argName "procName" -required 1 -type tclobj} {-argName "arguments" -required 1 -type tclobj} {-argName "body" -required 1 -type tclobj} } */ #if !defined(NSF_ASSEMBLE) static int -NsfAsmProcCmd(Tcl_Interp *interp, int with_ad, Tcl_Obj *nameObj, Tcl_Obj *arguments, Tcl_Obj *body) { +NsfAsmProcCmd(Tcl_Interp *interp, int with_ad, int with_checkAlways, Tcl_Obj *nameObj, Tcl_Obj *arguments, Tcl_Obj *body) { return TCL_OK; } #else static int -NsfAsmProcCmd(Tcl_Interp *interp, int with_ad, Tcl_Obj *nameObj, Tcl_Obj *arguments, Tcl_Obj *body) { +NsfAsmProcCmd(Tcl_Interp *interp, int with_ad, int with_checkAlways, Tcl_Obj *nameObj, Tcl_Obj *arguments, Tcl_Obj *body) { NsfParsedParam parsedParam; int result; /* @@ -19254,13 +19257,13 @@ /* * We need parameter handling. */ - result = NsfAsmProcAddParam(interp, &parsedParam, nameObj, body, with_ad); + result = NsfAsmProcAddParam(interp, &parsedParam, nameObj, body, with_ad, with_checkAlways); } else { /* * No parameter handling needed. */ - result = NsfAsmProcAddArgs(interp, arguments, nameObj, body, with_ad); + result = NsfAsmProcAddArgs(interp, arguments, nameObj, body, with_ad, with_checkAlways); } return result; @@ -21054,14 +21057,15 @@ /* cmd proc NsfProcCmd { - {-argName "-ad" -required 0} + {-argName "-ad" -required 0 -nrargs 0 -type switch} + {-argName "-checkalways" -required 0 -nrargs 0 -type switch} {-argName "procName" -required 1 -type tclobj} {-argName "arguments" -required 1 -type tclobj} {-argName "body" -required 1 -type tclobj} } */ static int -NsfProcCmd(Tcl_Interp *interp, int with_ad, Tcl_Obj *nameObj, Tcl_Obj *arguments, Tcl_Obj *body) { +NsfProcCmd(Tcl_Interp *interp, int with_ad, int with_checkAlways, Tcl_Obj *nameObj, Tcl_Obj *arguments, Tcl_Obj *body) { NsfParsedParam parsedParam; int result; /* @@ -21081,7 +21085,7 @@ * is added which handles the parameter passing and calls the proc * later. */ - result = NsfProcAdd(interp, &parsedParam, ObjStr(nameObj), body, with_ad); + result = NsfProcAdd(interp, &parsedParam, ObjStr(nameObj), body, with_ad, with_checkAlways); } else { /* Index: generic/nsfAPI.decls =================================================================== diff -u -r880487204ff2da18d2d25ebd727b9b4bbda86c8e -r1c21a6f9ab7fe20490ba256cb8cf3759b8498838 --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision 880487204ff2da18d2d25ebd727b9b4bbda86c8e) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision 1c21a6f9ab7fe20490ba256cb8cf3759b8498838) @@ -30,7 +30,8 @@ cmd __unset_unknown_args NsfUnsetUnknownArgsCmd {} cmd "asm::proc" NsfAsmProcCmd { - {-argName "-ad" -required 0 -nrargs 0} + {-argName "-ad" -required 0 -nrargs 0 -type switch} + {-argName "-checkalways" -required 0 -nrargs 0 -type switch} {-argName "procName" -required 1 -type tclobj} {-argName "arguments" -required 1 -type tclobj} {-argName "body" -required 1 -type tclobj} @@ -206,7 +207,8 @@ } cmd proc NsfProcCmd { - {-argName "-ad" -required 0 -nrargs 0} + {-argName "-ad" -required 0 -nrargs 0 -type switch} + {-argName "-checkalways" -required 0 -nrargs 0 -type switch} {-argName "procName" -required 1 -type tclobj} {-argName "arguments" -required 1 -type tclobj} {-argName "body" -required 1 -type tclobj} Index: generic/nsfAPI.h =================================================================== diff -u -r6b5a68878186b49871d420ee8e8d5c0f2c073222 -r1c21a6f9ab7fe20490ba256cb8cf3759b8498838 --- generic/nsfAPI.h (.../nsfAPI.h) (revision 6b5a68878186b49871d420ee8e8d5c0f2c073222) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision 1c21a6f9ab7fe20490ba256cb8cf3759b8498838) @@ -372,7 +372,7 @@ static int NsfClassInfoSubclassMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, CONST char *patternString, NsfObject *patternObject); static int NsfClassInfoSuperclassMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, Tcl_Obj *pattern); static int NsfAsmMethodCreateCmd(Tcl_Interp *interp, NsfObject *object, int withInner_namespace, int withPer_object, NsfObject *withReg_object, Tcl_Obj *name, Tcl_Obj *arguments, Tcl_Obj *body); -static int NsfAsmProcCmd(Tcl_Interp *interp, int withAd, Tcl_Obj *procName, Tcl_Obj *arguments, Tcl_Obj *body); +static int NsfAsmProcCmd(Tcl_Interp *interp, int withAd, int withCheckalways, Tcl_Obj *procName, Tcl_Obj *arguments, Tcl_Obj *body); static int NsfColonCmd(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); static int NsfConfigureCmd(Tcl_Interp *interp, int option, Tcl_Obj *value); static int NsfCurrentCmd(Tcl_Interp *interp, int option); @@ -403,7 +403,7 @@ static int NsfParameterInvalidateClassCacheCmd(Tcl_Interp *interp, NsfClass *class); static int NsfParameterInvalidateObjectCacheCmd(Tcl_Interp *interp, NsfObject *object); static int NsfParameterSpecsCmd(Tcl_Interp *interp, int withConfigure, int withNonposargs, Tcl_Obj *slotobjs); -static int NsfProcCmd(Tcl_Interp *interp, int withAd, Tcl_Obj *procName, Tcl_Obj *arguments, Tcl_Obj *body); +static int NsfProcCmd(Tcl_Interp *interp, int withAd, int withCheckalways, Tcl_Obj *procName, Tcl_Obj *arguments, Tcl_Obj *body); static int NsfProfileClearDataStub(Tcl_Interp *interp); static int NsfProfileGetDataStub(Tcl_Interp *interp); static int NsfRelationCmd(Tcl_Interp *interp, NsfObject *object, int type, Tcl_Obj *value); @@ -1102,12 +1102,13 @@ method_definitions[NsfAsmProcCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { int withAd = (int )PTR2INT(pc.clientData[0]); - Tcl_Obj *procName = (Tcl_Obj *)pc.clientData[1]; - Tcl_Obj *arguments = (Tcl_Obj *)pc.clientData[2]; - Tcl_Obj *body = (Tcl_Obj *)pc.clientData[3]; + int withCheckalways = (int )PTR2INT(pc.clientData[1]); + Tcl_Obj *procName = (Tcl_Obj *)pc.clientData[2]; + Tcl_Obj *arguments = (Tcl_Obj *)pc.clientData[3]; + Tcl_Obj *body = (Tcl_Obj *)pc.clientData[4]; assert(pc.status == 0); - return NsfAsmProcCmd(interp, withAd, procName, arguments, body); + return NsfAsmProcCmd(interp, withAd, withCheckalways, procName, arguments, body); } else { return TCL_ERROR; @@ -1717,12 +1718,13 @@ method_definitions[NsfProcCmdIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { int withAd = (int )PTR2INT(pc.clientData[0]); - Tcl_Obj *procName = (Tcl_Obj *)pc.clientData[1]; - Tcl_Obj *arguments = (Tcl_Obj *)pc.clientData[2]; - Tcl_Obj *body = (Tcl_Obj *)pc.clientData[3]; + int withCheckalways = (int )PTR2INT(pc.clientData[1]); + Tcl_Obj *procName = (Tcl_Obj *)pc.clientData[2]; + Tcl_Obj *arguments = (Tcl_Obj *)pc.clientData[3]; + Tcl_Obj *body = (Tcl_Obj *)pc.clientData[4]; assert(pc.status == 0); - return NsfProcCmd(interp, withAd, procName, arguments, body); + return NsfProcCmd(interp, withAd, withCheckalways, procName, arguments, body); } else { return TCL_ERROR; @@ -2751,8 +2753,9 @@ {"arguments", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"body", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::asm::proc", NsfAsmProcCmdStub, 4, { - {"-ad", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, +{"::nsf::asm::proc", NsfAsmProcCmdStub, 5, { + {"-ad", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, + {"-checkalways", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"procName", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"arguments", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"body", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} @@ -2905,8 +2908,9 @@ {"-nonposargs", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"slotobjs", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::proc", NsfProcCmdStub, 4, { - {"-ad", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, +{"::nsf::proc", NsfProcCmdStub, 5, { + {"-ad", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, + {"-checkalways", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"procName", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"arguments", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"body", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} Index: generic/nsfInt.h =================================================================== diff -u -r836e08bf2af69a30dcd2cf6bb2e19f97d798b98a -r1c21a6f9ab7fe20490ba256cb8cf3759b8498838 --- generic/nsfInt.h (.../nsfInt.h) (revision 836e08bf2af69a30dcd2cf6bb2e19f97d798b98a) +++ generic/nsfInt.h (.../nsfInt.h) (revision 1c21a6f9ab7fe20490ba256cb8cf3759b8498838) @@ -581,6 +581,7 @@ Tcl_Command cmd; NsfParamDefs *paramDefs; int with_ad; + int with_checkAlways; } NsfProcClientData; typedef enum SystemMethodsIdx {