Index: TODO =================================================================== diff -u -r66bbafa5fb1fe5c268131d7383fe3f8591aeb518 -rfbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4 --- TODO (.../TODO) (revision 66bbafa5fb1fe5c268131d7383fe3f8591aeb518) +++ TODO (.../TODO) (revision fbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4) @@ -4100,10 +4100,18 @@ - added additional regression test set for cget and configure - renamed testlog file, remove it on "make clean" + +nx.tcl: +- remove debugging output + +nsf.c: +- fixed parmeter syntax for required nonpos args +- deactivate deletion of methods via nsf::object::delete + during shutdown to avoid missing slot forwarders called from + destructors ======================================================================== TODO: -- why is parametersyntax of famnam incorrect in cget.test - use cget per default instead of accessor methods - default mechanism for accessor methods Index: generic/nsf.c =================================================================== diff -u -r8f14fdaf0de110b56e3132a178267f3372a32235 -rfbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4 --- generic/nsf.c (.../nsf.c) (revision 8f14fdaf0de110b56e3132a178267f3372a32235) +++ generic/nsf.c (.../nsf.c) (revision fbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4) @@ -9136,6 +9136,34 @@ /* *---------------------------------------------------------------------- + * NsfParamDefsSyntaxOne -- + * + * Appends the formatted parameter (provided as 2nd argument) to the + * content of the first argument. + * + * Results: + * None + * + * Side effects: + * Appending to first argument. + * + *---------------------------------------------------------------------- + */ + +static void +NsfParamDefsSyntaxOne(Tcl_Obj *argStringObj, Nsf_Param CONST *pPtr) { + Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); + if (pPtr->nrArgs > 0 && *pPtr->name == '-') { + Tcl_AppendLimitedToObj(argStringObj, " ", 1, INT_MAX, NULL); + Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), -1, INT_MAX, NULL); + if (pPtr->flags & NSF_ARG_MULTIVALUED) { + Tcl_AppendLimitedToObj(argStringObj, " ...", 4, INT_MAX, NULL); + } + } +} + +/* + *---------------------------------------------------------------------- * NsfParamDefsSyntax -- * * Return the parameter definitions of a sequence of parameters in @@ -9181,18 +9209,11 @@ if ((pPtr->flags & NSF_ARG_IS_ENUMERATION)) { Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), -1, INT_MAX, NULL); } else { - Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); + NsfParamDefsSyntaxOne(argStringObj, pPtr); } } else { Tcl_AppendLimitedToObj(argStringObj, "?", 1, INT_MAX, NULL); - Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); - if (pPtr->nrArgs > 0 && *pPtr->name == '-') { - Tcl_AppendLimitedToObj(argStringObj, " ", 1, INT_MAX, NULL); - Tcl_AppendLimitedToObj(argStringObj, ParamGetDomain(pPtr), -1, INT_MAX, NULL); - if (pPtr->flags & NSF_ARG_MULTIVALUED) { - Tcl_AppendLimitedToObj(argStringObj, " ...", 4, INT_MAX, NULL); - } - } + NsfParamDefsSyntaxOne(argStringObj, pPtr); Tcl_AppendLimitedToObj(argStringObj, "?", 1, INT_MAX, NULL); } } @@ -19442,10 +19463,14 @@ defObject = object; } - result = cl ? - NsfRemoveClassMethod(interp, (Nsf_Class *)defObject, methodName1) : - NsfRemoveObjectMethod(interp, (Nsf_Object *)defObject, methodName1); - + if (RUNTIME_STATE(interp)->exitHandlerDestroyRound == NSF_EXITHANDLER_OFF) { + result = cl ? + NsfRemoveClassMethod(interp, (Nsf_Class *)defObject, methodName1) : + NsfRemoveObjectMethod(interp, (Nsf_Object *)defObject, methodName1); + } else { + result = TCL_OK; + } + } else { result = NsfPrintError(interp, "%s: %s method '%s' does not exist", ObjectName(object), Index: library/xotcl/tests/testx.xotcl =================================================================== diff -u -r17ad6747e40c1724810371f92f0108b12c1d5284 -rfbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4 --- library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision 17ad6747e40c1724810371f92f0108b12c1d5284) +++ library/xotcl/tests/testx.xotcl (.../testx.xotcl) (revision fbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4) @@ -4048,7 +4048,7 @@ o z1 a 1 2 3 } m errorCheck $m {required argument 'x' is missing, should be: - ::o z1 -x ?-a value? a ?arg ...?} "required missing" + ::o z1 -x value ?-a value? a ?arg ...?} "required missing" errorCheck [o z1 -x 1 a 1 2 3] "1 -- 1 2 3" "invocation 1" errorCheck [o z2 -x 2 a 1 2 3] "2 -- a 1 2 3 -- 1 -- 1 2" "invocation 2" catch { Index: tests/cget.test =================================================================== diff -u -r8f14fdaf0de110b56e3132a178267f3372a32235 -rfbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4 --- tests/cget.test (.../cget.test) (revision 8f14fdaf0de110b56e3132a178267f3372a32235) +++ tests/cget.test (.../cget.test) (revision fbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4) @@ -20,7 +20,7 @@ } # - # first, check basic provided values and default + # first, check basic provided values and defaults # ? {p1 cget -age} 25 ? {p1 cget -famnam} hugo @@ -52,8 +52,7 @@ # # configure without arguments # - ? {p1 configure} "?-sex value? -famnam ?-age integer? ?-friends value ...? ?-volatile? ?-properties value? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?" - + ? {p1 configure} "?-sex value? -famnam value ?-age integer? ?-friends value ...? ?-volatile? ?-properties value? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?" } # Index: tests/disposition.test =================================================================== diff -u -r5c37eb1cd2b674337c60deeef1ecef4b663fa5ce -rfbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4 --- tests/disposition.test (.../disposition.test) (revision 5c37eb1cd2b674337c60deeef1ecef4b663fa5ce) +++ tests/disposition.test (.../disposition.test) (revision fbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4) @@ -197,7 +197,7 @@ "value for parameter '-x' expected" ? {[C new -single-np [list -x X]] eval {set :single-np}} \ "invalid non-positional argument '-x X', valid are : -x; - should be \"::__%&singleton single-np -x\"" + should be \"::__%&singleton single-np -x value\"" # # INTERACTIONS with other parameter types Index: tests/parameters.test =================================================================== diff -u -r5c37eb1cd2b674337c60deeef1ecef4b663fa5ce -rfbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4 --- tests/parameters.test (.../parameters.test) (revision 5c37eb1cd2b674337c60deeef1ecef4b663fa5ce) +++ tests/parameters.test (.../parameters.test) (revision fbdde5cf08cdbbbde43f1d5a8ddc836d66dc09f4) @@ -378,7 +378,7 @@ ? {D create d1} \ {required argument 'd' is missing, should be: - ::d1 __configure -d ?-a value? ?-b boolean? ?-c value? ?-volatile? ?-properties value? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?} + ::d1 __configure -d value ?-a value? ?-b boolean? ?-c value? ?-volatile? ?-properties value? ?-noinit? ?-mixin mixinreg ...? ?-class class? ?-filter filterreg ...? ?__initcmd?} ? {D create d2 -d x -b a} \ {expected boolean but got "a" for parameter "-b"} \ @@ -391,7 +391,7 @@ ? {d1 foo} \ {required argument 'r' is missing, should be: - ::d1 foo ?-b boolean? -r ?-x integer? ?-object object? ?-class class?} \ + ::d1 foo ?-b boolean? -r integer ?-x integer? ?-object object? ?-class class?} \ "call method without a required argument" ? {d1 foo -r a} \