Index: ChangeLog =================================================================== diff -u -recc8a110c338877202b900868da32eb8dcd561ad -ra75263f59ae32e00ec000fb423aa3d42690cd32c --- ChangeLog (.../ChangeLog) (revision ecc8a110c338877202b900868da32eb8dcd561ad) +++ ChangeLog (.../ChangeLog) (revision a75263f59ae32e00ec000fb423aa3d42690cd32c) @@ -63,6 +63,46 @@ C c1 ;# c1 has no no default value for "a", before it had one ====== +2009-08-05 + + - Finishing unset unspefied values in nonpos arg passing under + canonical args, when a nonposarg has no default, and the parameter + is not required, we have to unset the dummy default value. Since + causes some overhead, since unset is done via + ::xotcl::unsetUnknownArgs + + - Tried to reduce overhead of method invocation when no nonposArgs + are used, but failed, sind proc has has neither flags not + clientData + +2009-08-03 + + - releasing dynamically allocated parse contexts + - tried to reduce overhead of method invocation when no nonposArgs + are used, but failed, sind proc has has neither flags not + clientData + +2009-07-29 + + - improve canonical parser: make interface size explicit in method + definitions, new c function parseContextInit() for arbitrary sized + interfaces. + +2009-07-28 + + - compile switch CANONICAL_ARGUMENTS: Implemented a new idea to + handle nonpositional arguments: pass technically nonpos arguments + as positional arguments after being parsed by the objv parser used + everywhere else. The parse handles reordeing and arg checking. The + major advantages are conformity and speed, since we avoid the need + to call ::xotcl::interpretNonpositionalArgs. Only in cases, where + nonposargs are not required and no arguments are specified, we + have to reset the passed value. At this stage, the implementation + handles just the base cases. + +2009-07-24 + - removed duplicate line + 2009-07-07 - based introspection for procs/instprocs on new argument definition Index: generic/xotcl.c =================================================================== diff -u -r8d3eacad1a0602d7e55943bd35973a9a9e7ba05e -ra75263f59ae32e00ec000fb423aa3d42690cd32c --- generic/xotcl.c (.../xotcl.c) (revision 8d3eacad1a0602d7e55943bd35973a9a9e7ba05e) +++ generic/xotcl.c (.../xotcl.c) (revision a75263f59ae32e00ec000fb423aa3d42690cd32c) @@ -5491,17 +5491,6 @@ if (result == TCL_OK) { rst->cs.top->currentFramePtr = (Tcl_CallFrame *) Tcl_Interp_varFramePtr(interp); - - /* It would be nice to be able to call the arg parser - XOTclInterpretNonpositionalArgsCmd() here and not - ::xotcl::interpretNonpositionalArgs, but unfortonately, the - variable environment is setup by InitArgsAndLocals() from - TclObjInterpProcCore(), so we can't reach the variable scope - from here; TODO: look for a way.... - - XOTclInterpretNonpositionalArgsCmd(cp, interp, objc, objv); - */ - result = TclObjInterpProcCore(interp, objv[0], 1, &MakeProcError); } else { result = TCL_ERROR; @@ -9886,10 +9875,10 @@ } Tcl_SetObjResult(interp, list); } else { - /* ERROR HANDLING ****GN**** */ + /* TODO: ERROR HANDLING */ } } else { - /* ERROR HANDLING TODO ****GN**** */ + /* TODO: ERROR HANDLING TODO */ } rc = TCL_OK; } else { @@ -12478,9 +12467,10 @@ return XOTclVarErrMsg(interp, "method ",procName, ": required argument '", argName, "' is missing", (char *) NULL); } else { - /* we will have to unset later */ - /* XXX */ - pcPtr->objv[i] = XOTclGlobalObjects[XOTE___UNKNOWN]; /* TODO other symbol ? */ + /* Use as dummy default value an arbitrary symbol, normally + not provided returned to the Tcl level level; this value is + unset later by unsetUnknownArgs */ + pcPtr->objv[i] = XOTclGlobalObjects[XOTE___UNKNOWN__]; } } } @@ -12521,8 +12511,8 @@ varPtr = &Tcl_CallFrame_compiledLocals(varFramePtr)[i]; /*fprintf(stderr, "XOTclUnsetUnknownArgsCmd 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, - XOTclGlobalObjects[XOTE___UNKNOWN]);*/ - if (varPtr->value.objPtr != XOTclGlobalObjects[XOTE___UNKNOWN]) continue; + XOTclGlobalObjects[XOTE___UNKNOWN__]);*/ + if (varPtr->value.objPtr != XOTclGlobalObjects[XOTE___UNKNOWN__]) continue; /* fprintf(stderr, "XOTclUnsetUnknownArgsCmd must unset %s\n", ap->name);*/ Tcl_UnsetVar2(interp, ap->name, NULL, 0); } @@ -12557,7 +12547,9 @@ DECR_REF_COUNT(proc); if (rc != TCL_OK) { +#if defined(CANONICAL_ARGS) parseContextRelease(pcPtr); +#endif return rc; } @@ -12588,7 +12580,9 @@ /*fprintf(stderr,"=== setting default value '%s' for var '%s'\n",ObjStr(aPtr->defaultValue),argName);*/ Tcl_SetVar2Ex(interp, argName, NULL, aPtr->defaultValue, 0); } else if (aPtr->required) { +#if defined(CANONICAL_ARGS) parseContextRelease(pcPtr); +#endif return XOTclVarErrMsg(interp, "method ",procName, ": required argument '", argName, "' is missing", (char *) NULL); } @@ -12604,7 +12598,10 @@ } else { Tcl_UnsetVar2(interp, "args", NULL, 0); } + +#if defined(CANONICAL_ARGS) parseContextRelease(pcPtr); +#endif return TCL_OK; } #endif Index: generic/xotclInt.h =================================================================== diff -u -r120493167df5c1acf6449830ec9815f45015132f -ra75263f59ae32e00ec000fb423aa3d42690cd32c --- generic/xotclInt.h (.../xotclInt.h) (revision 120493167df5c1acf6449830ec9815f45015132f) +++ generic/xotclInt.h (.../xotclInt.h) (revision a75263f59ae32e00ec000fb423aa3d42690cd32c) @@ -535,7 +535,7 @@ XOTE_INSTCMD, XOTE_CMD, XOTE_INSTPARAMETERCMD, XOTE_PARAMETERCMD, XOTE_FORMAT, XOTE_INITSLOTS, XOTE_NEWOBJ, XOTE_GUARD_OPTION, XOTE_DEFAULTMETHOD, - XOTE___UNKNOWN, XOTE_ARGS, XOTE_SPLIT, XOTE_COMMA, + XOTE___UNKNOWN, XOTE___UNKNOWN__, XOTE_ARGS, XOTE_SPLIT, XOTE_COMMA, /** these are the redefined tcl commands; leave them together at the end */ XOTE_EXPR, XOTE_INFO, XOTE_RENAME, XOTE_SUBST @@ -555,7 +555,7 @@ "instcmd", "cmd", "instparametercmd", "parametercmd", "format", "initslots", "__#", "-guard", "defaultmethod", - "__unknown", "args", "split", ",", + "__unknown", "__unknown__", "args", "split", ",", "expr", "info", "rename", "subst", }; #endif