Index: TODO =================================================================== diff -u -rbd92cf0fcf5cb4388749a10ab542bf0199b00761 -rf4c75b01b24269f7a531ffcffed29d2acfbdbe91 --- TODO (.../TODO) (revision bd92cf0fcf5cb4388749a10ab542bf0199b00761) +++ TODO (.../TODO) (revision f4c75b01b24269f7a531ffcffed29d2acfbdbe91) @@ -2827,6 +2827,9 @@ or empty. - extended regression test +- bring defined commands in the source code in alphabetical order +- generate interface for NsfUnsetUnknownArgsCmd() +- delete some obsolete code TODO: Index: generic/gentclAPI.decls =================================================================== diff -u -rbd92cf0fcf5cb4388749a10ab542bf0199b00761 -rf4c75b01b24269f7a531ffcffed29d2acfbdbe91 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision bd92cf0fcf5cb4388749a10ab542bf0199b00761) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision f4c75b01b24269f7a531ffcffed29d2acfbdbe91) @@ -20,6 +20,7 @@ cmd __db_run_assertions NsfDebugRunAssertionsCmd {} cmd __profile_clear NsfProfileClearDataStub {} cmd __profile_get NsfProfileGetDataStub {} +cmd __unset_unknown_args NsfUnsetUnknownArgsCmd {} cmd configure NsfConfigureCmd { {-argName "configureoption" -required 1 -type "debug|dtrace|filter|profile|softrecreate|objectsystems|keepinitcmd|checkresults|checkarguments"} @@ -54,14 +55,14 @@ {-argName "value" -required 1 -type tclobj} } -cmd "method::alias" NsfAliasCmd { +cmd "method::alias" NsfMethodAliasCmd { {-argName "object" -required 1 -type object} {-argName "-per-object" -required 0} {-argName "methodName" -required 1} {-argName "-frame" -required 0 -nrargs 1 -type "method|object|default" -default "default"} {-argName "cmdName" -required 1 -type tclobj} } -cmd "method::assertion" NsfAssertionCmd { +cmd "method::assertion" NsfMethodAssertionCmd { {-argName "object" -required 1 -type object} {-argName "assertionsubcmd" -required 1 -nrargs 1 -type "check|object-invar|class-invar"} {-argName "arg" -required 0 -type tclobj} @@ -82,7 +83,7 @@ {-argName "-precondition" -nrargs 1 -type tclobj} {-argName "-postcondition" -nrargs 1 -type tclobj} } -cmd "method::forward" NsfForwardCmd { +cmd "method::forward" NsfMethodForwardCmd { {-argName "object" -required 1 -type object} {-argName "-per-object"} {-argName "method" -required 1 -type tclobj} @@ -105,7 +106,7 @@ cmd "method::registered" NsfMethodRegisteredCmd { {-argName "handle" -required 1 -type tclobj} } -cmd "method::setter" NsfSetterCmd { +cmd "method::setter" NsfMethodSetterCmd { {-argName "object" -required 1 -type object} {-argName "-per-object"} {-argName "parameter" -required 1 -type tclobj} Index: generic/nsf.c =================================================================== diff -u -rbd92cf0fcf5cb4388749a10ab542bf0199b00761 -rf4c75b01b24269f7a531ffcffed29d2acfbdbe91 --- generic/nsf.c (.../nsf.c) (revision bd92cf0fcf5cb4388749a10ab542bf0199b00761) +++ generic/nsf.c (.../nsf.c) (revision f4c75b01b24269f7a531ffcffed29d2acfbdbe91) @@ -265,8 +265,8 @@ static Tcl_Obj *AliasGet(Tcl_Interp *interp, Tcl_Obj *cmdName, CONST char *methodName, int withPer_object, int leaveError); static int AliasDeleteObjectReference(Tcl_Interp *interp, Tcl_Command cmd); -static int NsfAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, - CONST char *methodName, int withFrame, Tcl_Obj *cmdName); +static int NsfMethodAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, + CONST char *methodName, int withFrame, Tcl_Obj *cmdName); /* prototypes for (class) list handling */ static NsfClasses ** NsfClassListAdd(NsfClasses **firstPtrPtr, NsfClass *cl, ClientData clientData); @@ -2328,7 +2328,7 @@ : &osPtr->rootMetaClass->object; if (defObject != object) { - int result = NsfAliasCmd(interp, defObject, 0, methodName, 0, osPtr->handles[i]); + int result = NsfMethodAliasCmd(interp, defObject, 0, methodName, 0, osPtr->handles[i]); /* * Since the defObject is not equals the overloaded method, the @@ -10339,12 +10339,71 @@ return result; } +static int +ProcessMethodArguments(ParseContext *pcPtr, Tcl_Interp *interp, + NsfObject *object, int pushFrame, NsfParamDefs *paramDefs, + Tcl_Obj *methodNameObj, int objc, Tcl_Obj *CONST objv[]) { + int result; + CallFrame frame, *framePtr = &frame; + + if (object && pushFrame) { + Nsf_PushFrameObj(interp, object, framePtr); + } + + result = ArgumentParse(interp, objc, objv, object, methodNameObj, + paramDefs->paramsPtr, paramDefs->nrParams, + RUNTIME_STATE(interp)->doCheckArguments, + pcPtr); + if (object && pushFrame) { + Nsf_PopFrameObj(interp, framePtr); + } + if (result != TCL_OK) { + return result; + } + + /* + * Set objc of the parse context to the number of defined parameters. + * pcPtr->objc and paramDefs->nrParams will be equivalent in cases + * where argument values are passed to the call in absence of var + * args ('args'). Treating "args is more involved (see below). + */ + pcPtr->objc = paramDefs->nrParams + 1; + + if (pcPtr->varArgs) { + /* + * The last argument was "args". + */ + int elts = objc - pcPtr->lastobjc; + + if (elts == 0) { + /* + * No arguments were passed to "args". We simply decrement objc. + */ + pcPtr->objc--; + } else if (elts > 1) { + /* + * Multiple arguments were passed to "args". pcPtr->objv is + * pointing to the first of the var args. We have to copy the + * remaining actual argument vector objv to the parse context. + */ + + /*NsfPrintObjv("actual: ", objc, objv);*/ + ParseContextExtendObjv(pcPtr, paramDefs->nrParams, elts-1, objv + 1 + pcPtr->lastobjc); + } else { + /* + * A single argument was passed to "args". There is no need to + * mutate the pcPtr->objv, because this has been achieved in + * ArgumentParse (i.e., pcPtr->objv[i] contains this element). + */ + } + } + + return TCL_OK; +} /************************************************************************** * End Definition of Parameter procs (Tcl Procs with Parameter handling) **************************************************************************/ - - /* *---------------------------------------------------------------------- * ForwardCmdDeleteProc -- @@ -15290,9 +15349,9 @@ } -/******************************************* +/*********************************************************************** * Begin generated Next Scripting commands - *******************************************/ + ***********************************************************************/ /* nsfCmd __db_show_stack NsfShowStackCmd {} */ @@ -15397,224 +15456,47 @@ } /* -nsfCmd method::alias NsfAliasCmd { - {-argName "object" -type object} - {-argName "-per-object"} - {-argName "methodName"} - {-argName "-frame" -required 0 -nrargs 1 -type "method|object|default" -default "default"} - {-argName "cmdName" -required 1 -type tclobj} -} -*/ -static int -NsfAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, - CONST char *methodName, int withFrame, - Tcl_Obj *cmdName) { - Tcl_ObjCmdProc *objProc, *newObjProc = NULL; - Tcl_CmdDeleteProc *deleteProc = NULL; - AliasCmdClientData *tcd = NULL; /* make compiler happy */ - Tcl_Command cmd, newCmd = NULL; - Tcl_Namespace *nsPtr; - int flags, result; - NsfClass *cl = (withPer_object || ! NsfObjectIsClass(object)) ? NULL : (NsfClass *)object; - - cmd = Tcl_GetCommandFromObj(interp, cmdName); - if (cmd == NULL) { - return NsfPrintError(interp, "cannot lookup command '%s'", ObjStr(cmdName)); - } - - cmd = GetOriginalCommand(cmd); - objProc = Tcl_Command_objProc(cmd); - - /* objProc is either ... - - 1. NsfObjDispatch: a command representing an Next Scripting object - - 2. TclObjInterpProc: a cmd standing for a Tcl proc (including - Next Scripting methods), verified through CmdIsProc() -> to be - wrapped by NsfProcAliasMethod() - - 3. NsfForwardMethod: an Next Scripting forwarder - - 4. NsfSetterMethod: an Next Scripting setter - - 5. arbitrary Tcl commands (e.g. set, ..., ::nsf::relation, ...) - - TODO GN: i think, we should use NsfProcAliasMethod, whenever the clientData - is not 0. These are the cases, where the clientData will be freed, - when the original command is deleted. - */ - - if (withFrame == FrameObjectIdx) { - newObjProc = NsfObjscopedMethod; - } - - if (objProc == NsfObjDispatch) { - /* - * When we register an alias for an object, we have to take care to - * handle cases, where the aliased object is destroyed and the - * alias points to nowhere. We realize this via using the object - * refcount. - */ - /*fprintf(stderr, "registering an object %p\n", tcd);*/ - - NsfObjectRefCountIncr((NsfObject *)Tcl_Command_objClientData(cmd)); - - /*newObjProc = NsfProcAliasMethod;*/ - - } else if (CmdIsProc(cmd)) { - /* - * When we have a Tcl proc|nsf-method as alias, then use the - * wrapper, which will be deleted automatically when the original - * proc/method is deleted. - */ - newObjProc = NsfProcAliasMethod; - - if (objProc == TclObjInterpProc) { - /* - * We have an alias to a tcl proc; - */ - Proc *procPtr = (Proc *)Tcl_Command_objClientData(cmd); - Tcl_Obj *bodyObj = procPtr->bodyPtr; - - if (bodyObj->typePtr == Nsf_OT_byteCodeType) { - /* - * Flush old byte code - */ - /*fprintf(stderr, "flush byte code\n");*/ - bodyObj->typePtr->freeIntRepProc(bodyObj); - } - } - - if (withFrame && withFrame != FrameDefaultIdx) { - return NsfPrintError(interp, - "cannot use -frame object|method in alias for scripted command '%s'", - ObjStr(cmdName)); - } - } - - if (newObjProc) { - /* add a wrapper */ - /*fprintf(stderr, "NsfAliasCmd cmd %p\n", cmd);*/ - NsfCommandPreserve(cmd); - tcd = NEW(AliasCmdClientData); - tcd->cmdName = object->cmdName; - tcd->interp = interp; /* just for deleting the associated variable */ - tcd->object = NULL; - tcd->class = cl ? (NsfClass *) object : NULL; - tcd->objProc = objProc; - tcd->aliasedCmd = cmd; - tcd->clientData = Tcl_Command_objClientData(cmd); - objProc = newObjProc; - deleteProc = AliasCmdDeleteProc; - if (tcd->cmdName) {INCR_REF_COUNT(tcd->cmdName);} - } else { - /* - * Call the command directly (must be a c-implemented command not - * depending on a volatile client data) - */ - tcd = Tcl_Command_objClientData(cmd); - } - - flags = 0; - - if (cl) { - result = NsfAddClassMethod(interp, (Nsf_Class *)cl, methodName, - objProc, tcd, deleteProc, flags); - nsPtr = cl->nsPtr; - } else { - result = NsfAddObjectMethod(interp, (Nsf_Object *)object, methodName, - objProc, tcd, deleteProc, flags); - nsPtr = object->nsPtr; - } - - if (result == TCL_OK) { - newCmd = FindMethod(nsPtr, methodName); - } - -#if defined(WITH_IMPORT_REFS) - if (newObjProc) { - /* - * Define the reference chain like for 'namespace import' to - * obtain automatic deletes when the original command is deleted. - */ - ImportRef *refPtr = (ImportRef *) ckalloc(sizeof(ImportRef)); - refPtr->importedCmdPtr = (Command *) newCmd; - refPtr->nextPtr = ((Command *) tcd->aliasedCmd)->importRefPtr; - ((Command *) tcd->aliasedCmd)->importRefPtr = refPtr; - tcd->aliasCmd = newCmd; - } -#else - if (newObjProc) { - tcd->aliasCmd = newCmd; - } -#endif - - if (newCmd) { - AliasAdd(interp, object->cmdName, methodName, cl == NULL, ObjStr(cmdName)); - - if (withFrame == FrameMethodIdx) { - Tcl_Command_flags(newCmd) |= NSF_CMD_NONLEAF_METHOD; - /*fprintf(stderr, "setting aliased for cmd %p %s flags %.6x, tcd = %p\n", - newCmd,methodName,Tcl_Command_flags(newCmd), tcd);*/ - } - - Tcl_SetObjResult(interp, MethodHandleObj(object, cl == NULL, methodName)); - result = TCL_OK; - } - - return result; -} - + *---------------------------------------------------------------------- + * NsfUnsetUnknownArgsCmd -- +* + * Unset variables set from arguments with the default dummy + * default value. The dummy default values are set by + * ArgumentDefaults() + * + * Results: + * Tcl result code. + * + * Side effects: + * unsets some variables + * + *---------------------------------------------------------------------- + */ /* -nsfCmd method::assertion NsfAssertionCmd { - {-argName "object" -type object} - {-argName "assertionsubcmd" -required 1 -type "check|object-invar|class-invar"} - {-argName "arg" -required 0 -type tclobj} -} - - Make "::nsf::assertion" a cmd rather than a method, otherwise we - cannot define e.g. a "method check options {...}" to reset the check - options in case of a failed option, since assertion checking would - be applied on the sketched method already. +cmd __unset_unknown_args NsfUnsetUnknownArgsCmd {} */ static int -NsfAssertionCmd(Tcl_Interp *interp, NsfObject *object, int subcmd, Tcl_Obj *arg) { -#if defined(NSF_WITH_ASSERTIONS) - NsfClass *class; +NsfUnsetUnknownArgsCmd(Tcl_Interp *interp) { + CallFrame *varFramePtr = Tcl_Interp_varFramePtr(interp); + Proc *proc = Tcl_CallFrame_procPtr(varFramePtr); - switch (subcmd) { - case AssertionsubcmdCheckIdx: - if (arg) { - return AssertionSetCheckOptions(interp, object, arg); - } else { - return AssertionListCheckOption(interp, object); - } - break; + if (proc) { + CompiledLocal *ap; + Var *varPtr; + int i; - case AssertionsubcmdObject_invarIdx: - if (arg) { - NsfObjectOpt *opt = NsfRequireObjectOpt(object); - AssertionSetInvariants(interp, &opt->assertions, arg); - } else { - if (object->opt && object->opt->assertions) { - Tcl_SetObjResult(interp, AssertionList(interp, object->opt->assertions->invariants)); - } + for (ap = proc->firstLocalPtr, i=0; ap; ap = ap->nextPtr, i++) { + if (!TclIsCompiledLocalArgument(ap)) continue; + varPtr = &Tcl_CallFrame_compiledLocals(varFramePtr)[i]; + /*fprintf(stderr, "NsfUnsetUnknownArgsCmd var '%s' i %d fi %d var %p flags %.8x obj %p unk %p\n", + ap->name, i, ap->frameIndex, varPtr, varPtr->flags, varPtr->value.objPtr, + NsfGlobalObjs[NSF___UNKNOWN__]);*/ + if (varPtr->value.objPtr != NsfGlobalObjs[NSF___UNKNOWN__]) continue; + /*fprintf(stderr, "NsfUnsetUnknownArgsCmd must unset %s\n", ap->name);*/ + Tcl_UnsetVar2(interp, ap->name, NULL, 0); } - break; - - case AssertionsubcmdClass_invarIdx: - class = (NsfClass *)object; - if (arg) { - NsfClassOpt *opt = NsfRequireClassOpt(class); - AssertionSetInvariants(interp, &opt->assertions, arg); - } else { - if (class->opt && class->opt->assertions) { - Tcl_SetObjResult(interp, AssertionList(interp, class->opt->assertions->invariants)); - } - } } -#endif + return TCL_OK; } @@ -15991,24 +15873,6 @@ } /* -nsfCmd var::exists NsfExistsVarCmd { - {-argName "object" -required 1 -type object} - {-argName "varname" -required 1} -} -*/ -static int -NsfExistsVarCmd(Tcl_Interp *interp, NsfObject *object, CONST char *varName) { - - if (CheckVarName(interp, varName) != TCL_OK) { - return TCL_ERROR; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), VarExists(interp, object, varName, NULL, 1, 1)); - - return TCL_OK; -} - - -/* nsfCmd finalize NsfFinalizeObjCmd { } */ @@ -16047,102 +15911,8 @@ return TCL_OK; } -/* -nsfCmd method::forward NsfForwardCmd { - {-argName "object" -required 1 -type object} - {-argName "-per-object"} - {-argName "method" -required 1 -type tclobj} - {-argName "-default" -nrargs 1 -type tclobj} - {-argName "-earlybinding"} - {-argName "-methodprefix" -nrargs 1 -type tclobj} - {-argName "-objframe"} - {-argName "-onerror" -nrargs 1 -type tclobj} - {-argName "-verbose"} - {-argName "target" -type tclobj} - {-argName "args" -type args} -} -*/ -static int -NsfForwardCmd(Tcl_Interp *interp, - NsfObject *object, int withPer_object, - Tcl_Obj *methodObj, - Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix, - int withObjframe, Tcl_Obj *withOnerror, int withVerbose, - Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]) { - ForwardCmdClientData *tcd = NULL; - int result; - result = ForwardProcessOptions(interp, methodObj, - withDefault, withEarlybinding, withMethodprefix, - withObjframe, withOnerror, withVerbose, - target, nobjc, nobjv, &tcd); - if (result == TCL_OK) { - CONST char *methodName = NSTail(ObjStr(methodObj)); - NsfClass *cl = - (withPer_object || ! NsfObjectIsClass(object)) ? - NULL : (NsfClass *)object; - - tcd->object = object; - - if (cl == NULL) { - result = NsfAddObjectMethod(interp, (Nsf_Object *)object, methodName, - (Tcl_ObjCmdProc *)NsfForwardMethod, - (ClientData)tcd, ForwardCmdDeleteProc, 0); - } else { - result = NsfAddClassMethod(interp, (Nsf_Class *)cl, methodName, - (Tcl_ObjCmdProc *)NsfForwardMethod, - (ClientData)tcd, ForwardCmdDeleteProc, 0); - } - if (result == TCL_OK) { - Tcl_SetObjResult(interp, MethodHandleObj(object, withPer_object, methodName)); - } - } - - if (result != TCL_OK && tcd) { - ForwardCmdDeleteProc((ClientData)tcd); - } - return result; -} - /* -nsfCmd var::import NsfImportvarCmd { - {-argName "object" -type object} - {-argName "args" -type args} -} -*/ -static int -NsfImportvar(Tcl_Interp *interp, NsfObject *object, const char *cmdName, int objc, Tcl_Obj *CONST objv[]) { - int i, result = TCL_OK; - - for (i=0; i to be + wrapped by NsfProcAliasMethod() + + 3. NsfForwardMethod: an Next Scripting forwarder + + 4. NsfSetterMethod: an Next Scripting setter + + 5. arbitrary Tcl commands (e.g. set, ..., ::nsf::relation, ...) + + TODO GN: i think, we should use NsfProcAliasMethod, whenever the clientData + is not 0. These are the cases, where the clientData will be freed, + when the original command is deleted. + */ + + if (withFrame == FrameObjectIdx) { + newObjProc = NsfObjscopedMethod; + } + + if (objProc == NsfObjDispatch) { + /* + * When we register an alias for an object, we have to take care to + * handle cases, where the aliased object is destroyed and the + * alias points to nowhere. We realize this via using the object + * refcount. + */ + /*fprintf(stderr, "registering an object %p\n", tcd);*/ + + NsfObjectRefCountIncr((NsfObject *)Tcl_Command_objClientData(cmd)); + + /*newObjProc = NsfProcAliasMethod;*/ + + } else if (CmdIsProc(cmd)) { + /* + * When we have a Tcl proc|nsf-method as alias, then use the + * wrapper, which will be deleted automatically when the original + * proc/method is deleted. + */ + newObjProc = NsfProcAliasMethod; + + if (objProc == TclObjInterpProc) { + /* + * We have an alias to a tcl proc; + */ + Proc *procPtr = (Proc *)Tcl_Command_objClientData(cmd); + Tcl_Obj *bodyObj = procPtr->bodyPtr; + + if (bodyObj->typePtr == Nsf_OT_byteCodeType) { + /* + * Flush old byte code + */ + /*fprintf(stderr, "flush byte code\n");*/ + bodyObj->typePtr->freeIntRepProc(bodyObj); + } + } + + if (withFrame && withFrame != FrameDefaultIdx) { + return NsfPrintError(interp, + "cannot use -frame object|method in alias for scripted command '%s'", + ObjStr(cmdName)); + } + } + + if (newObjProc) { + /* add a wrapper */ + /*fprintf(stderr, "NsfMethodAliasCmd cmd %p\n", cmd);*/ + NsfCommandPreserve(cmd); + tcd = NEW(AliasCmdClientData); + tcd->cmdName = object->cmdName; + tcd->interp = interp; /* just for deleting the associated variable */ + tcd->object = NULL; + tcd->class = cl ? (NsfClass *) object : NULL; + tcd->objProc = objProc; + tcd->aliasedCmd = cmd; + tcd->clientData = Tcl_Command_objClientData(cmd); + objProc = newObjProc; + deleteProc = AliasCmdDeleteProc; + if (tcd->cmdName) {INCR_REF_COUNT(tcd->cmdName);} + } else { + /* + * Call the command directly (must be a c-implemented command not + * depending on a volatile client data) + */ + tcd = Tcl_Command_objClientData(cmd); + } + + flags = 0; + + if (cl) { + result = NsfAddClassMethod(interp, (Nsf_Class *)cl, methodName, + objProc, tcd, deleteProc, flags); + nsPtr = cl->nsPtr; + } else { + result = NsfAddObjectMethod(interp, (Nsf_Object *)object, methodName, + objProc, tcd, deleteProc, flags); + nsPtr = object->nsPtr; + } + + if (result == TCL_OK) { + newCmd = FindMethod(nsPtr, methodName); + } + +#if defined(WITH_IMPORT_REFS) + if (newObjProc) { + /* + * Define the reference chain like for 'namespace import' to + * obtain automatic deletes when the original command is deleted. + */ + ImportRef *refPtr = (ImportRef *) ckalloc(sizeof(ImportRef)); + refPtr->importedCmdPtr = (Command *) newCmd; + refPtr->nextPtr = ((Command *) tcd->aliasedCmd)->importRefPtr; + ((Command *) tcd->aliasedCmd)->importRefPtr = refPtr; + tcd->aliasCmd = newCmd; + } +#else + if (newObjProc) { + tcd->aliasCmd = newCmd; + } +#endif + + if (newCmd) { + AliasAdd(interp, object->cmdName, methodName, cl == NULL, ObjStr(cmdName)); + + if (withFrame == FrameMethodIdx) { + Tcl_Command_flags(newCmd) |= NSF_CMD_NONLEAF_METHOD; + /*fprintf(stderr, "setting aliased for cmd %p %s flags %.6x, tcd = %p\n", + newCmd,methodName,Tcl_Command_flags(newCmd), tcd);*/ + } + + Tcl_SetObjResult(interp, MethodHandleObj(object, cl == NULL, methodName)); + result = TCL_OK; + } + + return result; +} + /* +nsfCmd method::assertion NsfMethodAssertionCmd { + {-argName "object" -type object} + {-argName "assertionsubcmd" -required 1 -type "check|object-invar|class-invar"} + {-argName "arg" -required 0 -type tclobj} +} + + Make "::nsf::assertion" a cmd rather than a method, otherwise we + cannot define e.g. a "method check options {...}" to reset the check + options in case of a failed option, since assertion checking would + be applied on the sketched method already. +*/ + +static int +NsfMethodAssertionCmd(Tcl_Interp *interp, NsfObject *object, int subcmd, Tcl_Obj *arg) { +#if defined(NSF_WITH_ASSERTIONS) + NsfClass *class; + + switch (subcmd) { + case AssertionsubcmdCheckIdx: + if (arg) { + return AssertionSetCheckOptions(interp, object, arg); + } else { + return AssertionListCheckOption(interp, object); + } + break; + + case AssertionsubcmdObject_invarIdx: + if (arg) { + NsfObjectOpt *opt = NsfRequireObjectOpt(object); + AssertionSetInvariants(interp, &opt->assertions, arg); + } else { + if (object->opt && object->opt->assertions) { + Tcl_SetObjResult(interp, AssertionList(interp, object->opt->assertions->invariants)); + } + } + break; + + case AssertionsubcmdClass_invarIdx: + class = (NsfClass *)object; + if (arg) { + NsfClassOpt *opt = NsfRequireClassOpt(class); + AssertionSetInvariants(interp, &opt->assertions, arg); + } else { + if (class->opt && class->opt->assertions) { + Tcl_SetObjResult(interp, AssertionList(interp, class->opt->assertions->invariants)); + } + } + } +#endif + return TCL_OK; +} + +/* nsfCmd method::create NsfMethodCreateCmd { {-argName "object" -required 1 -type object} {-argName "-inner-namespace"} @@ -16290,6 +16281,63 @@ } /* +nsfCmd method::forward NsfMethodForwardCmd { + {-argName "object" -required 1 -type object} + {-argName "-per-object"} + {-argName "method" -required 1 -type tclobj} + {-argName "-default" -nrargs 1 -type tclobj} + {-argName "-earlybinding"} + {-argName "-methodprefix" -nrargs 1 -type tclobj} + {-argName "-objframe"} + {-argName "-onerror" -nrargs 1 -type tclobj} + {-argName "-verbose"} + {-argName "target" -type tclobj} + {-argName "args" -type args} +} +*/ +static int +NsfMethodForwardCmd(Tcl_Interp *interp, + NsfObject *object, int withPer_object, + Tcl_Obj *methodObj, + Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix, + int withObjframe, Tcl_Obj *withOnerror, int withVerbose, + Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]) { + ForwardCmdClientData *tcd = NULL; + int result; + + result = ForwardProcessOptions(interp, methodObj, + withDefault, withEarlybinding, withMethodprefix, + withObjframe, withOnerror, withVerbose, + target, nobjc, nobjv, &tcd); + if (result == TCL_OK) { + CONST char *methodName = NSTail(ObjStr(methodObj)); + NsfClass *cl = + (withPer_object || ! NsfObjectIsClass(object)) ? + NULL : (NsfClass *)object; + + tcd->object = object; + + if (cl == NULL) { + result = NsfAddObjectMethod(interp, (Nsf_Object *)object, methodName, + (Tcl_ObjCmdProc *)NsfForwardMethod, + (ClientData)tcd, ForwardCmdDeleteProc, 0); + } else { + result = NsfAddClassMethod(interp, (Nsf_Class *)cl, methodName, + (Tcl_ObjCmdProc *)NsfForwardMethod, + (ClientData)tcd, ForwardCmdDeleteProc, 0); + } + if (result == TCL_OK) { + Tcl_SetObjResult(interp, MethodHandleObj(object, withPer_object, methodName)); + } + } + + if (result != TCL_OK && tcd) { + ForwardCmdDeleteProc((ClientData)tcd); + } + return result; +} + +/* nsfCmd ::method::property NsfMethodPropertyCmd { {-argName "object" -required 1 -type object} {-argName "-per-object"} @@ -16458,6 +16506,71 @@ } /* +nsfCmd method::setter NsfMethodSetterCmd { + {-argName "object" -required 1 -type object} + {-argName "-per-object"} + {-argName "parameter" -type tclobj} + } +*/ +static int +NsfMethodSetterCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *parameter) { + NsfClass *cl = (withPer_object || ! NsfObjectIsClass(object)) ? NULL : (NsfClass *)object; + CONST char *methodName = ObjStr(parameter); + SetterCmdClientData *setterClientData; + size_t j, length; + int result; + + if (*methodName == '-' || *methodName == ':') { + return NsfPrintError(interp, "invalid setter name \"%s\" (must not start with a dash or colon)", + methodName); + } + + setterClientData = NEW(SetterCmdClientData); + setterClientData->object = NULL; + setterClientData->paramsPtr = NULL; + length = strlen(methodName); + + for (j=0; jparamsPtr = ParamsNew(1); + result = ParamParse(interp, NsfGlobalObjs[NSF_SETTER], parameter, + NSF_DISALLOWED_ARG_SETTER|NSF_ARG_HAS_DEFAULT, + setterClientData->paramsPtr, &possibleUnknowns, + &plainParams, &nrNonposArgs); + + if (result != TCL_OK) { + SetterCmdDeleteProc((ClientData)setterClientData); + return result; + } + methodName = setterClientData->paramsPtr->name; + } else { + setterClientData->paramsPtr = NULL; + } + + if (cl) { + result = NsfAddClassMethod(interp, (Nsf_Class *)cl, methodName, + (Tcl_ObjCmdProc *)NsfSetterMethod, + (ClientData)setterClientData, SetterCmdDeleteProc, 0); + } else { + result = NsfAddObjectMethod(interp, (Nsf_Object *)object, methodName, + (Tcl_ObjCmdProc *)NsfSetterMethod, + (ClientData)setterClientData, SetterCmdDeleteProc, 0); + } + if (result == TCL_OK) { + Tcl_SetObjResult(interp, MethodHandleObj(object, cl == NULL, methodName)); + } else { + SetterCmdDeleteProc((ClientData)setterClientData); + } + return result; +} + +/* nsfCmd my NsfMyCmd { {-argName "-local"} {-argName "method" -required 1 -type tclobj} @@ -17303,6 +17416,60 @@ } /* +nsfCmd var::exists NsfExistsVarCmd { + {-argName "object" -required 1 -type object} + {-argName "varname" -required 1} +} +*/ +static int +NsfExistsVarCmd(Tcl_Interp *interp, NsfObject *object, CONST char *varName) { + + if (CheckVarName(interp, varName) != TCL_OK) { + return TCL_ERROR; + } + Tcl_SetIntObj(Tcl_GetObjResult(interp), VarExists(interp, object, varName, NULL, 1, 1)); + + return TCL_OK; +} + +/* +nsfCmd var::import NsfImportvarCmd { + {-argName "object" -type object} + {-argName "args" -type args} +} +*/ +static int +NsfImportvar(Tcl_Interp *interp, NsfObject *object, const char *cmdName, int objc, Tcl_Obj *CONST objv[]) { + int i, result = TCL_OK; + + for (i=0; iobject = NULL; - setterClientData->paramsPtr = NULL; - length = strlen(methodName); - - for (j=0; jparamsPtr = ParamsNew(1); - result = ParamParse(interp, NsfGlobalObjs[NSF_SETTER], parameter, - NSF_DISALLOWED_ARG_SETTER|NSF_ARG_HAS_DEFAULT, - setterClientData->paramsPtr, &possibleUnknowns, - &plainParams, &nrNonposArgs); - - if (result != TCL_OK) { - SetterCmdDeleteProc((ClientData)setterClientData); - return result; - } - methodName = setterClientData->paramsPtr->name; - } else { - setterClientData->paramsPtr = NULL; - } - - if (cl) { - result = NsfAddClassMethod(interp, (Nsf_Class *)cl, methodName, - (Tcl_ObjCmdProc *)NsfSetterMethod, - (ClientData)setterClientData, SetterCmdDeleteProc, 0); - } else { - result = NsfAddObjectMethod(interp, (Nsf_Object *)object, methodName, - (Tcl_ObjCmdProc *)NsfSetterMethod, - (ClientData)setterClientData, SetterCmdDeleteProc, 0); - } - if (result == TCL_OK) { - Tcl_SetObjResult(interp, MethodHandleObj(object, cl == NULL, methodName)); - } else { - SetterCmdDeleteProc((ClientData)setterClientData); - } - return result; -} - typedef struct NsfParamWrapper { Nsf_Param *paramPtr; int refCount; @@ -17658,13 +17767,11 @@ return result; } -/***************************************** - * End generated Next Scripting commands - *****************************************/ -/*************************** + +/*********************************************************************** * Begin Object Methods - ***************************/ + ***********************************************************************/ /* objectMethod autoname NsfOAutonameMethod { {-argName "-instance"} @@ -18399,14 +18506,14 @@ return result; } -/*************************** +/*********************************************************************** * End Object Methods - ***************************/ + ***********************************************************************/ -/*************************** +/*********************************************************************** * Begin Class Methods - ***************************/ + ***********************************************************************/ static int NsfCAllocMethod_(Tcl_Interp *interp, NsfClass *cl, Tcl_Obj *nameObj, Tcl_Namespace *parentNsPtr) { @@ -18866,51 +18973,11 @@ return NsfRelationCmd(interp, &cl->object, RelationtypeSuperclassIdx, superclassesObj); } -/*************************** +/*********************************************************************** * End Class Methods - ***************************/ + ***********************************************************************/ -#if 0 -/*************************** - * Begin check Methods - ***************************/ static int -NsfCheckBooleanArgs(Tcl_Interp *interp, CONST char *name, Tcl_Obj *valueObj) { - int result, bool; - Tcl_Obj *boolean; - - if (value == NULL) { - /* the variable is not yet defined (set), so we cannot check - whether it is boolean or not */ - return TCL_OK; - } - - boolean = Tcl_DuplicateObj(valueObj); - INCR_REF_COUNT(boolean); - result = Tcl_GetBooleanFromObj(interp, boolean, &bool); - DECR_REF_COUNT(boolean); - - Tcl_ResetResult(interp); - Tcl_SetIntObj(Tcl_GetObjResult(interp), (result == TCL_OK)); - return TCL_OK; -} - -static int -NsfCheckRequiredArgs(Tcl_Interp *interp, CONST char *name, Tcl_Obj *valueObj) { - if (value == NULL) { - return NsfPrintError(interp, "required arg: '%s' missing", name); - } - Tcl_ResetResult(interp); - Tcl_SetIntObj(Tcl_GetObjResult(interp), 1); - return TCL_OK; -} - -/*************************** - * End check Methods - ***************************/ -#endif - -static int AggregatedMethodType(int methodType) { switch (methodType) { case MethodtypeNULL: /* default */ @@ -18946,9 +19013,9 @@ return methodType; } -/*************************** +/*********************************************************************** * Begin Object Info Methods - ***************************/ + ***********************************************************************/ /* objectInfoMethod children NsfObjInfoChildrenMethod { @@ -19441,13 +19508,13 @@ Tcl_SetObjResult(interp, okList); return TCL_OK; } -/*************************** +/*********************************************************************** * End Object Info Methods - ***************************/ + ***********************************************************************/ -/*************************** +/*********************************************************************** * Begin Class Info methods - ***************************/ + ***********************************************************************/ /* classInfoMethod filterguard NsfClassInfoFilterguardMethod { @@ -19924,119 +19991,14 @@ return ListSuperclasses(interp, class, pattern, withClosure); } -/*************************** +/*********************************************************************** * End Class Info methods - ***************************/ + ***********************************************************************/ /* - * New Tcl Commands + * Initialization and Exit handlers */ -static int -ProcessMethodArguments(ParseContext *pcPtr, Tcl_Interp *interp, - NsfObject *object, int pushFrame, NsfParamDefs *paramDefs, - Tcl_Obj *methodNameObj, int objc, Tcl_Obj *CONST objv[]) { - int result; - CallFrame frame, *framePtr = &frame; - - if (object && pushFrame) { - Nsf_PushFrameObj(interp, object, framePtr); - } - - result = ArgumentParse(interp, objc, objv, object, methodNameObj, - paramDefs->paramsPtr, paramDefs->nrParams, - RUNTIME_STATE(interp)->doCheckArguments, - pcPtr); - if (object && pushFrame) { - Nsf_PopFrameObj(interp, framePtr); - } - if (result != TCL_OK) { - return result; - } - - /* - * Set objc of the parse context to the number of defined parameters. - * pcPtr->objc and paramDefs->nrParams will be equivalent in cases - * where argument values are passed to the call in absence of var - * args ('args'). Treating "args is more involved (see below). - */ - pcPtr->objc = paramDefs->nrParams + 1; - - if (pcPtr->varArgs) { - /* - * The last argument was "args". - */ - int elts = objc - pcPtr->lastobjc; - - if (elts == 0) { - /* - * No arguments were passed to "args". We simply decrement objc. - */ - pcPtr->objc--; - } else if (elts > 1) { - /* - * Multiple arguments were passed to "args". pcPtr->objv is - * pointing to the first of the var args. We have to copy the - * remaining actual argument vector objv to the parse context. - */ - - /*NsfPrintObjv("actual: ", objc, objv);*/ - ParseContextExtendObjv(pcPtr, paramDefs->nrParams, elts-1, objv + 1 + pcPtr->lastobjc); - } else { - /* - * A single argument was passed to "args". There is no need to - * mutate the pcPtr->objv, because this has been achieved in - * ArgumentParse (i.e., pcPtr->objv[i] contains this element). - */ - } - } - - return TCL_OK; -} - -/* - *---------------------------------------------------------------------- - * NsfUnsetUnknownArgsCmd -- - * - * Unset variables set from arguments with the default dummy - * default value. The dummy default values are set by - * ArgumentDefaults() - * - * Results: - * Tcl result code. - * - * Side effects: - * unsets some variables - * - *---------------------------------------------------------------------- - */ -static int -NsfUnsetUnknownArgsCmd(ClientData UNUSED(clientData), Tcl_Interp *interp, - int UNUSED(objc), Tcl_Obj *CONST objv[]) { - CallFrame *varFramePtr = Tcl_Interp_varFramePtr(interp); - Proc *proc = Tcl_CallFrame_procPtr(varFramePtr); - (void)objv; - - if (proc) { - CompiledLocal *ap; - Var *varPtr; - int i; - - for (ap = proc->firstLocalPtr, i=0; ap; ap = ap->nextPtr, i++) { - if (!TclIsCompiledLocalArgument(ap)) continue; - varPtr = &Tcl_CallFrame_compiledLocals(varFramePtr)[i]; - /*fprintf(stderr, "NsfUnsetUnknownArgsCmd var '%s' i %d fi %d var %p flags %.8x obj %p unk %p\n", - ap->name, i, ap->frameIndex, varPtr, varPtr->flags, varPtr->value.objPtr, - NsfGlobalObjs[NSF___UNKNOWN__]);*/ - if (varPtr->value.objPtr != NsfGlobalObjs[NSF___UNKNOWN__]) continue; - /*fprintf(stderr, "NsfUnsetUnknownArgsCmd must unset %s\n", ap->name);*/ - Tcl_UnsetVar2(interp, ap->name, NULL, 0); - } - } - - return TCL_OK; -} - #ifdef DO_FULL_CLEANUP /* delete global variables and procs */ static void @@ -20514,9 +20476,6 @@ #endif /*Tcl_CreateObjCommand(interp, "::nsf::K", NsfKObjCmd, 0, 0);*/ - Tcl_CreateObjCommand(interp, "::nsf::__unset_unknown_args", - NsfUnsetUnknownArgsCmd, NULL, NULL); - #ifdef NSF_BYTECODE NsfBytecodeInit(); #endif Index: generic/tclAPI.h =================================================================== diff -u -rbd92cf0fcf5cb4388749a10ab542bf0199b00761 -rf4c75b01b24269f7a531ffcffed29d2acfbdbe91 --- generic/tclAPI.h (.../tclAPI.h) (revision bd92cf0fcf5cb4388749a10ab542bf0199b00761) +++ generic/tclAPI.h (.../tclAPI.h) (revision f4c75b01b24269f7a531ffcffed29d2acfbdbe91) @@ -77,53 +77,53 @@ return result; } -enum FrameIdx {FrameNULL, FrameMethodIdx, FrameObjectIdx, FrameDefaultIdx}; +enum ConfigureoptionIdx {ConfigureoptionNULL, ConfigureoptionDebugIdx, ConfigureoptionDtraceIdx, ConfigureoptionFilterIdx, ConfigureoptionProfileIdx, ConfigureoptionSoftrecreateIdx, ConfigureoptionObjectsystemsIdx, ConfigureoptionKeepinitcmdIdx, ConfigureoptionCheckresultsIdx, ConfigureoptionCheckargumentsIdx}; -static int ConvertToFrame(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, +static int ConvertToConfigureoption(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; - static CONST char *opts[] = {"method", "object", "default", NULL}; + static CONST char *opts[] = {"debug", "dtrace", "filter", "profile", "softrecreate", "objectsystems", "keepinitcmd", "checkresults", "checkarguments", NULL}; (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-frame", 0, &index); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "configureoption", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; } -enum AssertionsubcmdIdx {AssertionsubcmdNULL, AssertionsubcmdCheckIdx, AssertionsubcmdObject_invarIdx, AssertionsubcmdClass_invarIdx}; +enum CurrentoptionIdx {CurrentoptionNULL, CurrentoptionProcIdx, CurrentoptionMethodIdx, CurrentoptionMethodpathIdx, CurrentoptionObjectIdx, CurrentoptionClassIdx, CurrentoptionActivelevelIdx, CurrentoptionArgsIdx, CurrentoptionActivemixinIdx, CurrentoptionCalledprocIdx, CurrentoptionCalledmethodIdx, CurrentoptionCalledclassIdx, CurrentoptionCallingprocIdx, CurrentoptionCallingmethodIdx, CurrentoptionCallingclassIdx, CurrentoptionCallinglevelIdx, CurrentoptionCallingobjectIdx, CurrentoptionFilterregIdx, CurrentoptionIsnextcallIdx, CurrentoptionNextIdx}; -static int ConvertToAssertionsubcmd(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, +static int ConvertToCurrentoption(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; - static CONST char *opts[] = {"check", "object-invar", "class-invar", NULL}; + static CONST char *opts[] = {"proc", "method", "methodpath", "object", "class", "activelevel", "args", "activemixin", "calledproc", "calledmethod", "calledclass", "callingproc", "callingmethod", "callingclass", "callinglevel", "callingobject", "filterreg", "isnextcall", "next", NULL}; (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "assertionsubcmd", 0, &index); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "currentoption", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; } -enum ConfigureoptionIdx {ConfigureoptionNULL, ConfigureoptionDebugIdx, ConfigureoptionDtraceIdx, ConfigureoptionFilterIdx, ConfigureoptionProfileIdx, ConfigureoptionSoftrecreateIdx, ConfigureoptionObjectsystemsIdx, ConfigureoptionKeepinitcmdIdx, ConfigureoptionCheckresultsIdx, ConfigureoptionCheckargumentsIdx}; +enum FrameIdx {FrameNULL, FrameMethodIdx, FrameObjectIdx, FrameDefaultIdx}; -static int ConvertToConfigureoption(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, +static int ConvertToFrame(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; - static CONST char *opts[] = {"debug", "dtrace", "filter", "profile", "softrecreate", "objectsystems", "keepinitcmd", "checkresults", "checkarguments", NULL}; + static CONST char *opts[] = {"method", "object", "default", NULL}; (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "configureoption", 0, &index); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-frame", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; } -enum CurrentoptionIdx {CurrentoptionNULL, CurrentoptionProcIdx, CurrentoptionMethodIdx, CurrentoptionMethodpathIdx, CurrentoptionObjectIdx, CurrentoptionClassIdx, CurrentoptionActivelevelIdx, CurrentoptionArgsIdx, CurrentoptionActivemixinIdx, CurrentoptionCalledprocIdx, CurrentoptionCalledmethodIdx, CurrentoptionCalledclassIdx, CurrentoptionCallingprocIdx, CurrentoptionCallingmethodIdx, CurrentoptionCallingclassIdx, CurrentoptionCallinglevelIdx, CurrentoptionCallingobjectIdx, CurrentoptionFilterregIdx, CurrentoptionIsnextcallIdx, CurrentoptionNextIdx}; +enum AssertionsubcmdIdx {AssertionsubcmdNULL, AssertionsubcmdCheckIdx, AssertionsubcmdObject_invarIdx, AssertionsubcmdClass_invarIdx}; -static int ConvertToCurrentoption(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, +static int ConvertToAssertionsubcmd(Tcl_Interp *interp, Tcl_Obj *objPtr, Nsf_Param CONST *pPtr, ClientData *clientData, Tcl_Obj **outObjPtr) { int index, result; - static CONST char *opts[] = {"proc", "method", "methodpath", "object", "class", "activelevel", "args", "activemixin", "calledproc", "calledmethod", "calledclass", "callingproc", "callingmethod", "callingclass", "callinglevel", "callingobject", "filterreg", "isnextcall", "next", NULL}; + static CONST char *opts[] = {"check", "object-invar", "class-invar", NULL}; (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "currentoption", 0, &index); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "assertionsubcmd", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; @@ -218,8 +218,6 @@ static int NsfClassInfoSlotsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfClassInfoSubclassMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfClassInfoSuperclassMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int NsfAliasCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int NsfAssertionCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfColonCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfConfigureCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfCreateObjectSystemCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -228,16 +226,19 @@ static int NsfDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfExistsVarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfFinalizeObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int NsfForwardCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfImportvarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfInterpObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfInvalidateObjectParameterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfIsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfIsObjectCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfMethodAliasCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfMethodAssertionCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfMethodCreateCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfMethodDeleteCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfMethodForwardCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfMethodPropertyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfMethodRegisteredCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfMethodSetterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfMyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfNSCopyCmdsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfNSCopyVarsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -249,8 +250,8 @@ static int NsfRelationCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfSelfCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfSetVarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int NsfSetterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfShowStackCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfUnsetUnknownArgsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfUnsetVarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfOAutonameMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfOClassMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -311,8 +312,6 @@ static int NsfClassInfoSlotsMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, int withSource, NsfClass *withType, CONST char *pattern); static int NsfClassInfoSubclassMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, CONST char *patternString, NsfObject *patternObj); static int NsfClassInfoSuperclassMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, Tcl_Obj *pattern); -static int NsfAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, CONST char *methodName, int withFrame, Tcl_Obj *cmdName); -static int NsfAssertionCmd(Tcl_Interp *interp, NsfObject *object, int assertionsubcmd, Tcl_Obj *arg); static int NsfColonCmd(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]); static int NsfConfigureCmd(Tcl_Interp *interp, int configureoption, Tcl_Obj *value); static int NsfCreateObjectSystemCmd(Tcl_Interp *interp, Tcl_Obj *rootClass, Tcl_Obj *rootMetaClass, Tcl_Obj *systemMethods); @@ -321,16 +320,19 @@ static int NsfDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withFrame, Tcl_Obj *command, int nobjc, Tcl_Obj *CONST nobjv[]); static int NsfExistsVarCmd(Tcl_Interp *interp, NsfObject *object, CONST char *varName); static int NsfFinalizeObjCmd(Tcl_Interp *interp); -static int NsfForwardCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *method, Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix, int withObjframe, Tcl_Obj *withOnerror, int withVerbose, Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]); static int NsfImportvarCmd(Tcl_Interp *interp, NsfObject *object, int nobjc, Tcl_Obj *CONST nobjv[]); static int NsfInterpObjCmd(Tcl_Interp *interp, CONST char *name, int objc, Tcl_Obj *CONST objv[]); static int NsfInvalidateObjectParameterCmd(Tcl_Interp *interp, NsfClass *class); static int NsfIsCmd(Tcl_Interp *interp, int withComplain, Tcl_Obj *constraint, Tcl_Obj *value); static int NsfIsObjectCmd(Tcl_Interp *interp, Tcl_Obj *value); +static int NsfMethodAliasCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, CONST char *methodName, int withFrame, Tcl_Obj *cmdName); +static int NsfMethodAssertionCmd(Tcl_Interp *interp, NsfObject *object, int assertionsubcmd, Tcl_Obj *arg); static int NsfMethodCreateCmd(Tcl_Interp *interp, NsfObject *object, int withInner_namespace, int withPer_object, NsfObject *withReg_object, Tcl_Obj *methodName, Tcl_Obj *arguments, Tcl_Obj *body, Tcl_Obj *withPrecondition, Tcl_Obj *withPostcondition); static int NsfMethodDeleteCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName); +static int NsfMethodForwardCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *method, Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix, int withObjframe, Tcl_Obj *withOnerror, int withVerbose, Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]); static int NsfMethodPropertyCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName, int methodproperty, Tcl_Obj *value); static int NsfMethodRegisteredCmd(Tcl_Interp *interp, Tcl_Obj *handle); +static int NsfMethodSetterCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *parameter); static int NsfMyCmd(Tcl_Interp *interp, int withLocal, Tcl_Obj *methodName, int nobjc, Tcl_Obj *CONST nobjv[]); static int NsfNSCopyCmdsCmd(Tcl_Interp *interp, Tcl_Obj *fromNs, Tcl_Obj *toNs); static int NsfNSCopyVarsCmd(Tcl_Interp *interp, Tcl_Obj *fromNs, Tcl_Obj *toNs); @@ -342,8 +344,8 @@ static int NsfRelationCmd(Tcl_Interp *interp, NsfObject *object, int relationtype, Tcl_Obj *value); static int NsfSelfCmd(Tcl_Interp *interp); static int NsfSetVarCmd(Tcl_Interp *interp, NsfObject *object, Tcl_Obj *varName, Tcl_Obj *value); -static int NsfSetterCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *parameter); static int NsfShowStackCmd(Tcl_Interp *interp); +static int NsfUnsetUnknownArgsCmd(Tcl_Interp *interp); static int NsfUnsetVarCmd(Tcl_Interp *interp, NsfObject *object, Tcl_Obj *varName); static int NsfOAutonameMethod(Tcl_Interp *interp, NsfObject *obj, int withInstance, int withReset, Tcl_Obj *name); static int NsfOClassMethod(Tcl_Interp *interp, NsfObject *obj, Tcl_Obj *class); @@ -405,8 +407,6 @@ NsfClassInfoSlotsMethodIdx, NsfClassInfoSubclassMethodIdx, NsfClassInfoSuperclassMethodIdx, - NsfAliasCmdIdx, - NsfAssertionCmdIdx, NsfColonCmdIdx, NsfConfigureCmdIdx, NsfCreateObjectSystemCmdIdx, @@ -415,16 +415,19 @@ NsfDispatchCmdIdx, NsfExistsVarCmdIdx, NsfFinalizeObjCmdIdx, - NsfForwardCmdIdx, NsfImportvarCmdIdx, NsfInterpObjCmdIdx, NsfInvalidateObjectParameterCmdIdx, NsfIsCmdIdx, NsfIsObjectCmdIdx, + NsfMethodAliasCmdIdx, + NsfMethodAssertionCmdIdx, NsfMethodCreateCmdIdx, NsfMethodDeleteCmdIdx, + NsfMethodForwardCmdIdx, NsfMethodPropertyCmdIdx, NsfMethodRegisteredCmdIdx, + NsfMethodSetterCmdIdx, NsfMyCmdIdx, NsfNSCopyCmdsCmdIdx, NsfNSCopyVarsCmdIdx, @@ -436,8 +439,8 @@ NsfRelationCmdIdx, NsfSelfCmdIdx, NsfSetVarCmdIdx, - NsfSetterCmdIdx, NsfShowStackCmdIdx, + NsfUnsetUnknownArgsCmdIdx, NsfUnsetVarCmdIdx, NsfOAutonameMethodIdx, NsfOClassMethodIdx, @@ -966,50 +969,6 @@ } static int -NsfAliasCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - ParseContext pc; - (void)clientData; - - if (ArgumentParse(interp, objc, objv, NULL, objv[0], - method_definitions[NsfAliasCmdIdx].paramDefs, - method_definitions[NsfAliasCmdIdx].nrParameters, 1, - &pc) != TCL_OK) { - return TCL_ERROR; - } else { - NsfObject *object = (NsfObject *)pc.clientData[0]; - int withPer_object = (int )PTR2INT(pc.clientData[1]); - CONST char *methodName = (CONST char *)pc.clientData[2]; - int withFrame = (int )PTR2INT(pc.clientData[3]); - Tcl_Obj *cmdName = (Tcl_Obj *)pc.clientData[4]; - - assert(pc.status == 0); - return NsfAliasCmd(interp, object, withPer_object, methodName, withFrame, cmdName); - - } -} - -static int -NsfAssertionCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - ParseContext pc; - (void)clientData; - - if (ArgumentParse(interp, objc, objv, NULL, objv[0], - method_definitions[NsfAssertionCmdIdx].paramDefs, - method_definitions[NsfAssertionCmdIdx].nrParameters, 1, - &pc) != TCL_OK) { - return TCL_ERROR; - } else { - NsfObject *object = (NsfObject *)pc.clientData[0]; - int assertionsubcmd = (int )PTR2INT(pc.clientData[1]); - Tcl_Obj *arg = (Tcl_Obj *)pc.clientData[2]; - - assert(pc.status == 0); - return NsfAssertionCmd(interp, object, assertionsubcmd, arg); - - } -} - -static int NsfColonCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { (void)clientData; @@ -1153,34 +1112,6 @@ } static int -NsfForwardCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - ParseContext pc; - (void)clientData; - - if (ArgumentParse(interp, objc, objv, NULL, objv[0], - method_definitions[NsfForwardCmdIdx].paramDefs, - method_definitions[NsfForwardCmdIdx].nrParameters, 1, - &pc) != TCL_OK) { - return TCL_ERROR; - } else { - NsfObject *object = (NsfObject *)pc.clientData[0]; - int withPer_object = (int )PTR2INT(pc.clientData[1]); - Tcl_Obj *method = (Tcl_Obj *)pc.clientData[2]; - Tcl_Obj *withDefault = (Tcl_Obj *)pc.clientData[3]; - int withEarlybinding = (int )PTR2INT(pc.clientData[4]); - Tcl_Obj *withMethodprefix = (Tcl_Obj *)pc.clientData[5]; - int withObjframe = (int )PTR2INT(pc.clientData[6]); - Tcl_Obj *withOnerror = (Tcl_Obj *)pc.clientData[7]; - int withVerbose = (int )PTR2INT(pc.clientData[8]); - Tcl_Obj *target = (Tcl_Obj *)pc.clientData[9]; - - assert(pc.status == 0); - return NsfForwardCmd(interp, object, withPer_object, method, withDefault, withEarlybinding, withMethodprefix, withObjframe, withOnerror, withVerbose, target, objc-pc.lastobjc, objv+pc.lastobjc); - - } -} - -static int NsfImportvarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; (void)clientData; @@ -1275,6 +1206,50 @@ } static int +NsfMethodAliasCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + ParseContext pc; + (void)clientData; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[NsfMethodAliasCmdIdx].paramDefs, + method_definitions[NsfMethodAliasCmdIdx].nrParameters, 1, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + NsfObject *object = (NsfObject *)pc.clientData[0]; + int withPer_object = (int )PTR2INT(pc.clientData[1]); + CONST char *methodName = (CONST char *)pc.clientData[2]; + int withFrame = (int )PTR2INT(pc.clientData[3]); + Tcl_Obj *cmdName = (Tcl_Obj *)pc.clientData[4]; + + assert(pc.status == 0); + return NsfMethodAliasCmd(interp, object, withPer_object, methodName, withFrame, cmdName); + + } +} + +static int +NsfMethodAssertionCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + ParseContext pc; + (void)clientData; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[NsfMethodAssertionCmdIdx].paramDefs, + method_definitions[NsfMethodAssertionCmdIdx].nrParameters, 1, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + NsfObject *object = (NsfObject *)pc.clientData[0]; + int assertionsubcmd = (int )PTR2INT(pc.clientData[1]); + Tcl_Obj *arg = (Tcl_Obj *)pc.clientData[2]; + + assert(pc.status == 0); + return NsfMethodAssertionCmd(interp, object, assertionsubcmd, arg); + + } +} + +static int NsfMethodCreateCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; (void)clientData; @@ -1323,6 +1298,34 @@ } static int +NsfMethodForwardCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + ParseContext pc; + (void)clientData; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[NsfMethodForwardCmdIdx].paramDefs, + method_definitions[NsfMethodForwardCmdIdx].nrParameters, 1, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + NsfObject *object = (NsfObject *)pc.clientData[0]; + int withPer_object = (int )PTR2INT(pc.clientData[1]); + Tcl_Obj *method = (Tcl_Obj *)pc.clientData[2]; + Tcl_Obj *withDefault = (Tcl_Obj *)pc.clientData[3]; + int withEarlybinding = (int )PTR2INT(pc.clientData[4]); + Tcl_Obj *withMethodprefix = (Tcl_Obj *)pc.clientData[5]; + int withObjframe = (int )PTR2INT(pc.clientData[6]); + Tcl_Obj *withOnerror = (Tcl_Obj *)pc.clientData[7]; + int withVerbose = (int )PTR2INT(pc.clientData[8]); + Tcl_Obj *target = (Tcl_Obj *)pc.clientData[9]; + + assert(pc.status == 0); + return NsfMethodForwardCmd(interp, object, withPer_object, method, withDefault, withEarlybinding, withMethodprefix, withObjframe, withOnerror, withVerbose, target, objc-pc.lastobjc, objv+pc.lastobjc); + + } +} + +static int NsfMethodPropertyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; (void)clientData; @@ -1362,6 +1365,27 @@ } static int +NsfMethodSetterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + ParseContext pc; + (void)clientData; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[NsfMethodSetterCmdIdx].paramDefs, + method_definitions[NsfMethodSetterCmdIdx].nrParameters, 1, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + NsfObject *object = (NsfObject *)pc.clientData[0]; + int withPer_object = (int )PTR2INT(pc.clientData[1]); + Tcl_Obj *parameter = (Tcl_Obj *)pc.clientData[2]; + + assert(pc.status == 0); + return NsfMethodSetterCmd(interp, object, withPer_object, parameter); + + } +} + +static int NsfMyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; (void)clientData; @@ -1566,39 +1590,34 @@ } static int -NsfSetterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - ParseContext pc; +NsfShowStackCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { (void)clientData; - if (ArgumentParse(interp, objc, objv, NULL, objv[0], - method_definitions[NsfSetterCmdIdx].paramDefs, - method_definitions[NsfSetterCmdIdx].nrParameters, 1, - &pc) != TCL_OK) { - return TCL_ERROR; - } else { - NsfObject *object = (NsfObject *)pc.clientData[0]; - int withPer_object = (int )PTR2INT(pc.clientData[1]); - Tcl_Obj *parameter = (Tcl_Obj *)pc.clientData[2]; + - assert(pc.status == 0); - return NsfSetterCmd(interp, object, withPer_object, parameter); + if (objc != 1) { + return NsfArgumentError(interp, "too many arguments:", + method_definitions[NsfShowStackCmdIdx].paramDefs, + NULL, objv[0]); + } + + return NsfShowStackCmd(interp); - } } static int -NsfShowStackCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfUnsetUnknownArgsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { (void)clientData; if (objc != 1) { return NsfArgumentError(interp, "too many arguments:", - method_definitions[NsfShowStackCmdIdx].paramDefs, + method_definitions[NsfUnsetUnknownArgsCmdIdx].paramDefs, NULL, objv[0]); } - return NsfShowStackCmd(interp); + return NsfUnsetUnknownArgsCmd(interp); } @@ -2363,18 +2382,6 @@ {"-closure", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"pattern", 0, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::method::alias", NsfAliasCmdStub, 5, { - {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"methodName", NSF_ARG_REQUIRED, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-frame", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToFrame, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"cmdName", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} -}, -{"::nsf::method::assertion", NsfAssertionCmdStub, 3, { - {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"assertionsubcmd", NSF_ARG_REQUIRED|NSF_ARG_IS_ENUMERATION, 1, ConvertToAssertionsubcmd, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"arg", 0, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} -}, {"::nsf::colon", NsfColonCmdStub, 1, { {"args", 0, 0, ConvertToNothing, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, @@ -2406,19 +2413,6 @@ {"::nsf::finalize", NsfFinalizeObjCmdStub, 0, { {NULL, 0, 0, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::method::forward", NsfForwardCmdStub, 11, { - {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"method", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-default", 0, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-earlybinding", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-methodprefix", 0, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-objframe", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-onerror", 0, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-verbose", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"target", 0, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"args", 0, 0, ConvertToNothing, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} -}, {"::nsf::var::import", NsfImportvarCmdStub, 2, { {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"args", 0, 0, ConvertToNothing, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} @@ -2438,6 +2432,18 @@ {"::nsf::object::exists", NsfIsObjectCmdStub, 1, { {"value", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, +{"::nsf::method::alias", NsfMethodAliasCmdStub, 5, { + {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"methodName", NSF_ARG_REQUIRED, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-frame", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToFrame, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"cmdName", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} +}, +{"::nsf::method::assertion", NsfMethodAssertionCmdStub, 3, { + {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"assertionsubcmd", NSF_ARG_REQUIRED|NSF_ARG_IS_ENUMERATION, 1, ConvertToAssertionsubcmd, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"arg", 0, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} +}, {"::nsf::method::create", NsfMethodCreateCmdStub, 9, { {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-inner-namespace", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, @@ -2454,6 +2460,19 @@ {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"methodName", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, +{"::nsf::method::forward", NsfMethodForwardCmdStub, 11, { + {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"method", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-default", 0, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-earlybinding", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-methodprefix", 0, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-objframe", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-onerror", 0, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-verbose", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"target", 0, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"args", 0, 0, ConvertToNothing, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} +}, {"::nsf::method::property", NsfMethodPropertyCmdStub, 5, { {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, @@ -2464,6 +2483,11 @@ {"::nsf::method::registered", NsfMethodRegisteredCmdStub, 1, { {"handle", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, +{"::nsf::method::setter", NsfMethodSetterCmdStub, 3, { + {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"parameter", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} +}, {"::nsf::my", NsfMyCmdStub, 3, { {"-local", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"methodName", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, @@ -2508,14 +2532,12 @@ {"varName", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"value", 0, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::method::setter", NsfSetterCmdStub, 3, { - {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"parameter", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} -}, {"::nsf::__db_show_stack", NsfShowStackCmdStub, 0, { {NULL, 0, 0, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, +{"::nsf::__unset_unknown_args", NsfUnsetUnknownArgsCmdStub, 0, { + {NULL, 0, 0, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL}} +}, {"::nsf::var::unset", NsfUnsetVarCmdStub, 2, { {"object", NSF_ARG_REQUIRED, 0, Nsf_ConvertToObject, NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"varName", NSF_ARG_REQUIRED, 0, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL}}