Index: TODO =================================================================== diff -u -re70316835cf50554ec304bc7ddadea6743be5c81 -r0c534a6693afbced7859c4189b62e712acc8f955 --- TODO (.../TODO) (revision e70316835cf50554ec304bc7ddadea6743be5c81) +++ TODO (.../TODO) (revision 0c534a6693afbced7859c4189b62e712acc8f955) @@ -1649,6 +1649,10 @@ - defined unknown methods as call-protected - make __default_method_protection protected +- added syntax "?arg ...?" in parametsyntax output for "args" +- removed "info forward" from nx::Object and nx::Class + (can be replaced by "info methods" and "info method") + TODO: - cleanup of xotcl-aol Index: generic/gentclAPI.decls =================================================================== diff -u -r11911b4cef79513ac212b56be4270d1fb7a78ad6 -r0c534a6693afbced7859c4189b62e712acc8f955 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 11911b4cef79513ac212b56be4270d1fb7a78ad6) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 0c534a6693afbced7859c4189b62e712acc8f955) @@ -226,7 +226,7 @@ objectInfoMethod class NsfObjInfoClassMethod { } objectInfoMethod filterguard NsfObjInfoFilterguardMethod { - {-argName "filter" -required 1} + {-argName "name" -required 1} } objectInfoMethod filtermethods NsfObjInfoFiltermethodsMethod { {-argName "-guards"} Index: generic/nsf.c =================================================================== diff -u -re70316835cf50554ec304bc7ddadea6743be5c81 -r0c534a6693afbced7859c4189b62e712acc8f955 --- generic/nsf.c (.../nsf.c) (revision e70316835cf50554ec304bc7ddadea6743be5c81) +++ generic/nsf.c (.../nsf.c) (revision 0c534a6693afbced7859c4189b62e712acc8f955) @@ -6037,7 +6037,9 @@ if (pPtr != paramPtr) { Tcl_AppendLimitedToObj(argStringObj, " ", 1, INT_MAX, NULL); } - if (pPtr->flags & NSF_ARG_REQUIRED) { + if (pPtr->converter == ConvertToNothing && strcmp(pPtr->name, "args") == 0) { + Tcl_AppendLimitedToObj(argStringObj, "?arg ...?", 9, INT_MAX, NULL); + } else if (pPtr->flags & NSF_ARG_REQUIRED) { Tcl_AppendLimitedToObj(argStringObj, pPtr->name, -1, INT_MAX, NULL); } else { Tcl_AppendLimitedToObj(argStringObj, "?", 1, INT_MAX, NULL); @@ -11290,12 +11292,19 @@ continue; } - innerlist = Tcl_NewListObj(0, NULL); - Tcl_ListObjAppendElement(interp, innerlist, Tcl_NewStringObj(args->name, -1)); - if (!withVarnames && args->defValuePtr) { - Tcl_ListObjAppendElement(interp, innerlist, args->defValuePtr); - } - Tcl_ListObjAppendElement(interp, list, innerlist); + if (withVarnames == 2 && strcmp(args->name, "args") == 0) { + if (args != procPtr->firstLocalPtr) { + Tcl_AppendToObj(list, " ", 1); + } + Tcl_AppendToObj(list, "?arg ...?", 9); + } else { + innerlist = Tcl_NewListObj(0, NULL); + Tcl_ListObjAppendElement(interp, innerlist, Tcl_NewStringObj(args->name, -1)); + if (!withVarnames && args->defValuePtr) { + Tcl_ListObjAppendElement(interp, innerlist, args->defValuePtr); + } + Tcl_ListObjAppendElement(interp, list, innerlist); + } } } @@ -11312,7 +11321,7 @@ for (; mdPtr->methodName; mdPtr ++) { /*fprintf(stderr, "... comparing %p with %p => %s\n", ((Command *)cmd)->objProc, mdPtr->proc, - mdPtr->methodName);*/ + mdPtr->methodName);*/ if (((Command *)cmd)->objProc == mdPtr->proc) { NsfParamDefs paramDefs = {mdPtr->paramDefs, mdPtr->nrParameters}; Index: generic/tclAPI.h =================================================================== diff -u -r11911b4cef79513ac212b56be4270d1fb7a78ad6 -r0c534a6693afbced7859c4189b62e712acc8f955 --- generic/tclAPI.h (.../tclAPI.h) (revision 11911b4cef79513ac212b56be4270d1fb7a78ad6) +++ generic/tclAPI.h (.../tclAPI.h) (revision 0c534a6693afbced7859c4189b62e712acc8f955) @@ -293,7 +293,7 @@ static int NsfOVwaitMethod(Tcl_Interp *interp, NsfObject *obj, CONST char *varname); static int NsfObjInfoChildrenMethod(Tcl_Interp *interp, NsfObject *obj, NsfClass *withType, CONST char *pattern); static int NsfObjInfoClassMethod(Tcl_Interp *interp, NsfObject *obj); -static int NsfObjInfoFilterguardMethod(Tcl_Interp *interp, NsfObject *obj, CONST char *filter); +static int NsfObjInfoFilterguardMethod(Tcl_Interp *interp, NsfObject *obj, CONST char *name); static int NsfObjInfoFiltermethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withGuards, int withOrder, CONST char *pattern); static int NsfObjInfoForwardMethod(Tcl_Interp *interp, NsfObject *obj, int withDefinition, CONST char *name); static int NsfObjInfoHasMixinMethod(Tcl_Interp *interp, NsfObject *obj, NsfClass *class); @@ -1668,10 +1668,10 @@ &pc) != TCL_OK) { return TCL_ERROR; } else { - CONST char *filter = (CONST char *)pc.clientData[0]; + CONST char *name = (CONST char *)pc.clientData[0]; ParseContextRelease(&pc); - return NsfObjInfoFilterguardMethod(interp, obj, filter); + return NsfObjInfoFilterguardMethod(interp, obj, name); } } @@ -2302,7 +2302,7 @@ } }, {"::nsf::methods::object::info::filterguard", NsfObjInfoFilterguardMethodStub, 1, { - {"filter", 1, 0, ConvertToString}} + {"name", 1, 0, ConvertToString}} }, {"::nsf::methods::object::info::filtermethods", NsfObjInfoFiltermethodsMethodStub, 3, { {"-guards", 0, 0, ConvertToString}, Index: library/nx/nx.tcl =================================================================== diff -u -re70316835cf50554ec304bc7ddadea6743be5c81 -r0c534a6693afbced7859c4189b62e712acc8f955 --- library/nx/nx.tcl (.../nx.tcl) (revision e70316835cf50554ec304bc7ddadea6743be5c81) +++ library/nx/nx.tcl (.../nx.tcl) (revision 0c534a6693afbced7859c4189b62e712acc8f955) @@ -300,11 +300,11 @@ # Add setter methods. # - Object public method setter {methodName} { - ::nsf::setter [::nsf::current object] -per-object $methodName + Object public method setter {parameter} { + ::nsf::setter [::nsf::current object] -per-object $parameter } - Class public method setter {methodName} { - ::nsf::setter [::nsf::current object] $methodName + Class public method setter {parameter} { + ::nsf::setter [::nsf::current object] $parameter } # Add method "require" @@ -424,7 +424,7 @@ :alias "info class" ::nsf::methods::object::info::class :alias "info filter guard" ::nsf::methods::object::info::filterguard :alias "info filter methods" ::nsf::methods::object::info::filtermethods - :alias "info forward" ::nsf::methods::object::info::forward + #:alias "info forward" ::nsf::methods::object::info::forward :alias "info has mixin" ::nsf::methods::object::info::hasmixin :alias "info has namespace" ::nsf::methods::object::info::hasnamespace :alias "info has type" ::nsf::methods::object::info::hastype @@ -465,7 +465,7 @@ :alias "info lookup" ::nx::Object::slot::__info::lookup :alias "info filter guard" ::nsf::methods::class::info::filterguard :alias "info filter methods" ::nsf::methods::class::info::filtermethods - :alias "info forward" ::nsf::methods::class::info::forward + #:alias "info forward" ::nsf::methods::class::info::forward :alias "info has" ::nx::Object::slot::__info::has :alias "info heritage" ::nsf::methods::class::info::heritage :alias "info instances" ::nsf::methods::class::info::instances Index: tests/forwardtest.tcl =================================================================== diff -u -r51725aa434e18e9e3ce656897011c4f40c98d8dd -r0c534a6693afbced7859c4189b62e712acc8f955 --- tests/forwardtest.tcl (.../forwardtest.tcl) (revision 51725aa434e18e9e3ce656897011c4f40c98d8dd) +++ tests/forwardtest.tcl (.../forwardtest.tcl) (revision 0c534a6693afbced7859c4189b62e712acc8f955) @@ -127,16 +127,16 @@ :forward Info -methodprefix @ Info %1 %self } - ? {C info forward} Info + ? {C info methods -methodtype forwarder} Info C forward XXXo x - ? {lsort [C info forward]} [list Info XXXo] + ? {lsort [C info methods -methodtype forwarder]} [list Info XXXo] - ? {C info forward X*} [list XXXo] - ? {lsort [C info forward *o]} [list Info XXXo] + ? {C info methods -methodtype forwarder X*} [list XXXo] + ? {lsort [C info methods -methodtype forwarder *o]} [list Info XXXo] # delete the forwarder C method XXXo {} {} - ? {C info forward} [list Info] + ? {C info methods -methodtype forwarder} [list Info] # get the definition of a instforwarder ? {C info method definition Info} [list ::C public forward Info -methodprefix @ Info %1 %self] @@ -149,11 +149,11 @@ :forward addOne expr 1 + } - ? {lsort [obj info forward]} "Mixin addOne foo i1" - ? {obj info forward -definition Mixin} "mixin %1 %self" - ? {obj info forward -definition addOne} "expr 1 +" - ? {obj info forward -definition foo} "target %proc %self %%self %%p" - ? {obj info forward -definition i1} "-objscope ::incr x" + ? {lsort [obj info methods -methodtype forwarder]} "Mixin addOne foo i1" + ? {obj info method definition Mixin} "::obj public forward Mixin mixin %1 %self" + ? {obj info method definition addOne} "::obj public forward addOne expr 1 +" + ? {obj info method definition foo} "::obj public forward foo target %proc %self %%self %%p" + ? {obj info method definition i1} "::obj public forward i1 -objscope ::incr x" } ########################################### Index: tests/submethods.tcl =================================================================== diff -u -re70316835cf50554ec304bc7ddadea6743be5c81 -r0c534a6693afbced7859c4189b62e712acc8f955 --- tests/submethods.tcl (.../submethods.tcl) (revision e70316835cf50554ec304bc7ddadea6743be5c81) +++ tests/submethods.tcl (.../submethods.tcl) (revision 0c534a6693afbced7859c4189b62e712acc8f955) @@ -225,7 +225,7 @@ # defaultcmd has to return also subcmds of other shadowed ensembles ? {lsort [o1 info has]} "Valid submethods of ::o1 info has: mixin namespace something type" - ? {lsort [o1 info]} "Valid submethods of ::o1 info: children class filter forward has info is lookup method methods mixin parent precedence slots vars" + ? {lsort [o1 info]} "Valid submethods of ::o1 info: children class filter has info is lookup method methods mixin parent precedence slots vars" # returning methodpath in ensemble ? {o1 info has something path} "info has something path"