Index: TODO =================================================================== diff -u -r9f406d2897995c76c5f7166c76fe27a561039347 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- TODO (.../TODO) (revision 9f406d2897995c76c5f7166c76fe27a561039347) +++ TODO (.../TODO) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -4461,13 +4461,19 @@ - nsf.c: handle full-qualified name for private slots (AddSlotObjects()) - extended regression test +- C-code Generator: added "-typeName" for enumeration types that + allows for disambiguation of enumerations with different argument + names. Before that, the argument name determined the c-type of the + enumeration. Therefore it was not possible to use argName "-type" + for two different functions with a different list of enumerators. + +- changed "-methodtype" to simply "-type" in + /obj/ info methods ... ?-type all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ... + /obj/ info object methods ... ?-type all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ... + /obj/ info lookup methods ... ?-type all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ... + ======================================================================== TODO: -- The two names are not appropriate - /cls/ delete property /name/ - /obj/ delete object property /name/ - maybe call it "delete ?object? variable" and - call these "variable handlers" - valuechangedcmd implemented via initcmd does not work with "configure" method - fix property inheritance in traits (nx-traits.tcl) @@ -4749,10 +4755,6 @@ for nsf::proc * toplevel (object less) introspection -- ".... info methods -methodtype scripted ....." and "info lookup - method -methodtype ..." vs. "info method type ...."; spricht was - dagegen, anstelle von "methodtype" nur "type" zu verwenden? - - documentation * migration guide 3.8. Dispatch, Aliases, etc.: to be done or omitted Index: doc/next-migration.html =================================================================== diff -u -r74bae7e8ef9109fbcd95b77be8cf422ce330b59d -rd79efb10b92ad2045196990af50bc042e60b88f4 --- doc/next-migration.html (.../next-migration.html) (revision 74bae7e8ef9109fbcd95b77be8cf422ce330b59d) +++ doc/next-migration.html (.../next-migration.html) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -3297,8 +3297,15 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ delete property /name/
-/obj/ delete object property /name/
+
# Like deletion of Methods:
+# Delete on the object, where the
+# variable handler is defined.
+
+/cls/ delete property /name/
+/obj/ delete object property /name/
+
+/cls/ delete variable /name/
+/obj/ delete object variable /name/
@@ -3799,7 +3806,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -methodtype setter ?pattern?
+
/cls/ info methods -type setter ?pattern?
@@ -3825,7 +3832,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -methodtype scripted ?pattern?
+
/cls/ info methods -type scripted ?pattern?
@@ -3851,7 +3858,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -methodtype alias ?pattern?
+
/cls/ info methods -type alias ?pattern?
@@ -3877,7 +3884,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -methodtype forwarder ?pattern?
+
/cls/ info methods -type forwarder ?pattern?
@@ -3903,7 +3910,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/cls/ info methods -methodtype object ?pattern?
+
/cls/ info methods -type object ?pattern?
@@ -4005,7 +4012,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info object methods -methodtype setter ?pattern?
+
/obj/ info object methods -type setter ?pattern?
@@ -4031,7 +4038,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info object methods -methodtype scripted ?pattern?
+
/obj/ info object methods -type scripted ?pattern?
@@ -4057,7 +4064,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info object methods -methodtype alias ?pattern?
+
/obj/ info object methods -type alias ?pattern?
@@ -4083,7 +4090,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info object methods -methodtype forwarder ?pattern?
+
/obj/ info object methods -type forwarder ?pattern?
@@ -4109,7 +4116,7 @@ .nx-placeholder {color: #AF663F; font-weight: normal; font-style: italic;} .nx-variable {color: #AF663F; font-weight: normal; font-style: normal;} -
/obj/ info object methods -methodtype object ?pattern?
+
/obj/ info object methods -type object ?pattern?
@@ -4306,7 +4313,7 @@ # -source ... # -callprotection ... # -incontext -# -methodtype ... +# -type ... # -nomixins
@@ -6630,7 +6637,7 @@ Index: doc/next-migration.txt =================================================================== diff -u -r74bae7e8ef9109fbcd95b77be8cf422ce330b59d -rd79efb10b92ad2045196990af50bc042e60b88f4 --- doc/next-migration.txt (.../next-migration.txt) (revision 74bae7e8ef9109fbcd95b77be8cf422ce330b59d) +++ doc/next-migration.txt (.../next-migration.txt) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -1514,8 +1514,15 @@ ---------------- |[source,tcl] ---------------- +# Like deletion of Methods: +# Delete on the object, where the +# variable handler is defined. + /cls/ delete property /name/ /obj/ delete object property /name/ + +/cls/ delete variable /name/ +/obj/ delete object variable /name/ ---------------- |====================== @@ -1803,39 +1810,39 @@ ---------------- |[source,tcl] ---------------- -/cls/ info methods -methodtype setter ?pattern? +/cls/ info methods -type setter ?pattern? ---------------- |[source,tcl] ---------------- /cls/ info instprocs ?pattern? ---------------- |[source,tcl] ---------------- -/cls/ info methods -methodtype scripted ?pattern? +/cls/ info methods -type scripted ?pattern? ---------------- |[source,tcl] ---------------- # n.a. ---------------- |[source,tcl] ---------------- -/cls/ info methods -methodtype alias ?pattern? +/cls/ info methods -type alias ?pattern? ---------------- |[source,tcl] ---------------- # n.a. ---------------- |[source,tcl] ---------------- -/cls/ info methods -methodtype forwarder ?pattern? +/cls/ info methods -type forwarder ?pattern? ---------------- |[source,tcl] ---------------- # n.a. ---------------- |[source,tcl] ---------------- -/cls/ info methods -methodtype object ?pattern? +/cls/ info methods -type object ?pattern? ---------------- |[source,tcl] ---------------- @@ -1872,39 +1879,39 @@ ---------------- |[source,tcl] ---------------- -/obj/ info object methods -methodtype setter ?pattern? +/obj/ info object methods -type setter ?pattern? ---------------- |[source,tcl] ---------------- /obj/ info procs ?pattern? ---------------- |[source,tcl] ---------------- -/obj/ info object methods -methodtype scripted ?pattern? +/obj/ info object methods -type scripted ?pattern? ---------------- |[source,tcl] ---------------- # n.a. ---------------- |[source,tcl] ---------------- -/obj/ info object methods -methodtype alias ?pattern? +/obj/ info object methods -type alias ?pattern? ---------------- |[source,tcl] ---------------- # n.a. ---------------- |[source,tcl] ---------------- -/obj/ info object methods -methodtype forwarder ?pattern? +/obj/ info object methods -type forwarder ?pattern? ---------------- |[source,tcl] ---------------- # n.a. ---------------- |[source,tcl] ---------------- -/obj/ info object methods -methodtype object ?pattern? +/obj/ info object methods -type object ?pattern? ---------------- |[source,tcl] ---------------- @@ -1990,7 +1997,7 @@ # -source ... # -callprotection ... # -incontext -# -methodtype ... +# -type ... # -nomixins ---------------- |[source,tcl] Index: generic/gentclAPI.tcl =================================================================== diff -u -rc96782fabd01fbfc8d11365dcc649d2788f78aa3 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- generic/gentclAPI.tcl (.../gentclAPI.tcl) (revision c96782fabd01fbfc8d11365dcc649d2788f78aa3) +++ generic/gentclAPI.tcl (.../gentclAPI.tcl) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -32,12 +32,12 @@ set ::converter "" set ::objCmdProc "(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv \[\]);" -proc convertername {type argname} { - return [string totitle [string trimleft $argname -]] +proc convertername {type typename} { + return [string totitle [string trimleft $typename -]] } -proc createconverter {type argname} { - set name [convertername $type $argname] +proc createconverter {type typename} { + set name [convertername $type $typename] if {[info exists ::createdConverter($name)]} { return "" } @@ -54,7 +54,7 @@ int index, result; $opts (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "$argname", 0, &index); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "$typename", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; @@ -66,6 +66,7 @@ #puts stderr $parameterDefinitions set l [list] foreach parameterDefinition $parameterDefinitions { + array unset "" array set "" $parameterDefinition switch $(-type) { "" {set type NULL} @@ -85,9 +86,10 @@ "args" {set converter Nothing} "allargs" {set converter Nothing} "objpattern" {set converter Objpattern} - *|* { - set converter [convertername $type $(-argName)] - append ::converter [createconverter $type $(-argName)] + *|* { + if {![info exists (-typeName)]} {set (-typeName) $(-argName)} + set converter [convertername $type $(-typeName)] + append ::converter [createconverter $type $(-typeName)] set (-argName) $type append flags |NSF_ARG_IS_ENUMERATION } @@ -438,6 +440,7 @@ } set completed [list] foreach parameterDefinition $parameterDefinitions { + array unset "" array set "" {-required 0 -nrargs 1 -type "" -withObj 0} array set "" $parameterDefinition lappend completed [array get ""] Index: generic/nsf.c =================================================================== diff -u -r719959e71a23301318a68eef99122cd78cf0cc91 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- generic/nsf.c (.../nsf.c) (revision 719959e71a23301318a68eef99122cd78cf0cc91) +++ generic/nsf.c (.../nsf.c) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -23846,7 +23846,7 @@ objectInfoMethod lookupmethods NsfObjInfoLookupMethodsMethod { {-argName "-callprotection" -nrargs 1 -type "all|public|protected|private" -default all} {-argName "-incontext"} - {-argName "-methodtype" -nrargs 1 -type "all|scripted|builtin|alias|forwarder|object|setter"} + {-argName "-type" -nrargs 1 -typeName "methodtype" -type "all|scripted|builtin|alias|forwarder|object|setter"} {-argName "-nomixins"} {-argName "-path" -nrargs 0} {-argName "-source" -nrargs 1 -type "all|application|baseclasses"} @@ -24032,7 +24032,7 @@ /* objectInfoMethod methods NsfObjInfoMethodsMethod { {-argName "-callprotection" -type "all|public|protected|private" -default all} - {-argName "-methodtype" -nrargs 1 -type "all|scripted|builtin|alias|forwarder|object|setter"} + {-argName "-type" -nrargs 1 -typeName "methodtype" -type "all|scripted|builtin|alias|forwarder|object|setter"} {-argName "-path" -nrargs 0} {-argName "pattern"} } @@ -24449,7 +24449,7 @@ classInfoMethod methods NsfClassInfoMethodsMethod { {-argName "-callprotection" -type "all|public|protected|private" -default all} {-argName "-closure" -nrargs 0} - {-argName "-methodtype" -nrargs 1 -type "all|scripted|builtin|alias|forwarder|object|setter"} + {-argName "-type" -typeName "methodtype" -nrargs 1 -type "all|scripted|builtin|alias|forwarder|object|setter"} {-argName "-path" -nrargs 0} {-argName "-source" -nrargs 1 -type "all|application|baseclasses"} {-argName "pattern"} Index: generic/nsfAPI.decls =================================================================== diff -u -r2d9fcf7f4dc9ccd8ac52702850f60724a04bcba4 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision 2d9fcf7f4dc9ccd8ac52702850f60724a04bcba4) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -400,10 +400,10 @@ objectInfoMethod lookupmethods NsfObjInfoLookupMethodsMethod { {-argName "-callprotection" -type "all|public|protected|private" -default all} {-argName "-incontext" -nrargs 0} - {-argName "-methodtype" -type "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"} + {-argName "-type" -typeName "methodtype" -type "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"} {-argName "-nomixins" -nrargs 0} {-argName "-path" -nrargs 0} - {-argName "-source" -type "all|application|baseclasses"} + {-argName "-source" -type "all|application|baseclasses" -default all} {-argName "pattern" -required 0} } objectInfoMethod lookupslots NsfObjInfoLookupSlotsMethod { @@ -417,7 +417,7 @@ } objectInfoMethod methods NsfObjInfoMethodsMethod { {-argName "-callprotection" -type "all|public|protected|private" -default all} - {-argName "-methodtype" -type "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"} + {-argName "-type" -typeName "methodtype" -type "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"} {-argName "-path" -nrargs 0} {-argName "pattern" -required 0} } @@ -479,9 +479,9 @@ classInfoMethod methods NsfClassInfoMethodsMethod { {-argName "-callprotection" -type "all|public|protected|private" -default all} {-argName "-closure" -nrargs 0} - {-argName "-methodtype" -nrargs 1 -type "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"} + {-argName "-type" -nrargs 1 -typeName "methodtype" -type "all|scripted|builtin|alias|forwarder|object|setter|nsfproc"} {-argName "-path" -nrargs 0} - {-argName "-source" -nrargs 1 -type "all|application|baseclasses"} + {-argName "-source" -nrargs 1 -type "all|application|baseclasses" -default all} {-argName "pattern"} } classInfoMethod mixinclasses NsfClassInfoMixinclassesMethod { Index: generic/nsfAPI.h =================================================================== diff -u -r2d9fcf7f4dc9ccd8ac52702850f60724a04bcba4 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- generic/nsfAPI.h (.../nsfAPI.h) (revision 2d9fcf7f4dc9ccd8ac52702850f60724a04bcba4) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -52,7 +52,7 @@ int index, result; static CONST char *opts[] = {"all", "scripted", "builtin", "alias", "forwarder", "object", "setter", "nsfproc", NULL}; (void)pPtr; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "-methodtype", 0, &index); + result = Tcl_GetIndexFromObj(interp, objPtr, opts, "methodtype", 0, &index); *clientData = (ClientData) INT2PTR(index + 1); *outObjPtr = objPtr; return result; @@ -365,7 +365,7 @@ static int NsfClassInfoHeritageMethod(Tcl_Interp *interp, NsfClass *cl, CONST char *pattern); static int NsfClassInfoInstancesMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, CONST char *patternString, NsfObject *patternObject); static int NsfClassInfoMethodMethod(Tcl_Interp *interp, NsfClass *cl, int infomethodsubcmd, Tcl_Obj *name); -static int NsfClassInfoMethodsMethod(Tcl_Interp *interp, NsfClass *cl, int withCallprotection, int withClosure, int withMethodtype, int withPath, int withSource, CONST char *pattern); +static int NsfClassInfoMethodsMethod(Tcl_Interp *interp, NsfClass *cl, int withCallprotection, int withClosure, int withType, int withPath, int withSource, CONST char *pattern); static int NsfClassInfoMixinOfMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, int withScope, CONST char *patternString, NsfObject *patternObject); static int NsfClassInfoMixinclassesMethod(Tcl_Interp *interp, NsfClass *cl, int withClosure, int withGuards, int withHeritage, CONST char *patternString, NsfObject *patternObject); static int NsfClassInfoMixinguardMethod(Tcl_Interp *interp, NsfClass *cl, CONST char *mixin); @@ -443,10 +443,10 @@ static int NsfObjInfoIsMethod(Tcl_Interp *interp, NsfObject *obj, int objectkind); static int NsfObjInfoLookupFilterMethod(Tcl_Interp *interp, NsfObject *obj, CONST char *filter); static int NsfObjInfoLookupMethodMethod(Tcl_Interp *interp, NsfObject *obj, Tcl_Obj *name); -static int NsfObjInfoLookupMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withCallprotection, int withIncontext, int withMethodtype, int withNomixins, int withPath, int withSource, CONST char *pattern); +static int NsfObjInfoLookupMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withCallprotection, int withIncontext, int withType, int withNomixins, int withPath, int withSource, CONST char *pattern); static int NsfObjInfoLookupSlotsMethod(Tcl_Interp *interp, NsfObject *obj, int withSource, NsfClass *withType, CONST char *pattern); static int NsfObjInfoMethodMethod(Tcl_Interp *interp, NsfObject *obj, int infomethodsubcmd, Tcl_Obj *name); -static int NsfObjInfoMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withCallprotection, int withMethodtype, int withPath, CONST char *pattern); +static int NsfObjInfoMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withCallprotection, int withType, int withPath, CONST char *pattern); static int NsfObjInfoMixinclassesMethod(Tcl_Interp *interp, NsfObject *obj, int withGuards, int withHeritage, CONST char *patternString, NsfObject *patternObject); static int NsfObjInfoMixinguardMethod(Tcl_Interp *interp, NsfObject *obj, CONST char *mixin); static int NsfObjInfoNameMethod(Tcl_Interp *interp, NsfObject *obj); @@ -885,13 +885,13 @@ &pc) == TCL_OK)) { int withCallprotection = (int )PTR2INT(pc.clientData[0]); int withClosure = (int )PTR2INT(pc.clientData[1]); - int withMethodtype = (int )PTR2INT(pc.clientData[2]); + int withType = (int )PTR2INT(pc.clientData[2]); int withPath = (int )PTR2INT(pc.clientData[3]); int withSource = (int )PTR2INT(pc.clientData[4]); CONST char *pattern = (CONST char *)pc.clientData[5]; assert(pc.status == 0); - return NsfClassInfoMethodsMethod(interp, cl, withCallprotection, withClosure, withMethodtype, withPath, withSource, pattern); + return NsfClassInfoMethodsMethod(interp, cl, withCallprotection, withClosure, withType, withPath, withSource, pattern); } else { return TCL_ERROR; @@ -2419,14 +2419,14 @@ &pc) == TCL_OK)) { int withCallprotection = (int )PTR2INT(pc.clientData[0]); int withIncontext = (int )PTR2INT(pc.clientData[1]); - int withMethodtype = (int )PTR2INT(pc.clientData[2]); + int withType = (int )PTR2INT(pc.clientData[2]); int withNomixins = (int )PTR2INT(pc.clientData[3]); int withPath = (int )PTR2INT(pc.clientData[4]); int withSource = (int )PTR2INT(pc.clientData[5]); CONST char *pattern = (CONST char *)pc.clientData[6]; assert(pc.status == 0); - return NsfObjInfoLookupMethodsMethod(interp, obj, withCallprotection, withIncontext, withMethodtype, withNomixins, withPath, withSource, pattern); + return NsfObjInfoLookupMethodsMethod(interp, obj, withCallprotection, withIncontext, withType, withNomixins, withPath, withSource, pattern); } else { return TCL_ERROR; @@ -2487,12 +2487,12 @@ method_definitions[NsfObjInfoMethodsMethodIdx].nrParameters, 0, NSF_ARGPARSE_BUILTIN, &pc) == TCL_OK)) { int withCallprotection = (int )PTR2INT(pc.clientData[0]); - int withMethodtype = (int )PTR2INT(pc.clientData[1]); + int withType = (int )PTR2INT(pc.clientData[1]); int withPath = (int )PTR2INT(pc.clientData[2]); CONST char *pattern = (CONST char *)pc.clientData[3]; assert(pc.status == 0); - return NsfObjInfoMethodsMethod(interp, obj, withCallprotection, withMethodtype, withPath, pattern); + return NsfObjInfoMethodsMethod(interp, obj, withCallprotection, withType, withPath, pattern); } else { return TCL_ERROR; @@ -2730,7 +2730,7 @@ {"::nsf::methods::class::info::methods", NsfClassInfoMethodsMethodStub, 6, { {"-callprotection", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToCallprotection, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-closure", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-methodtype", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToMethodtype, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-type", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToMethodtype, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-path", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-source", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToSource, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"pattern", 0, 1, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} @@ -3066,7 +3066,7 @@ {"::nsf::methods::object::info::lookupmethods", NsfObjInfoLookupMethodsMethodStub, 7, { {"-callprotection", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToCallprotection, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-incontext", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-methodtype", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToMethodtype, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-type", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToMethodtype, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-nomixins", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-path", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-source", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToSource, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, @@ -3083,7 +3083,7 @@ }, {"::nsf::methods::object::info::methods", NsfObjInfoMethodsMethodStub, 4, { {"-callprotection", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToCallprotection, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-methodtype", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToMethodtype, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-type", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToMethodtype, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-path", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"pattern", 0, 1, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, Index: library/lib/nxdoc-dc.tcl =================================================================== diff -u -re0f9892926cd7c2c3bf54a1e7d1d945a5c77e7ca -rd79efb10b92ad2045196990af50bc042e60b88f4 --- library/lib/nxdoc-dc.tcl (.../nxdoc-dc.tcl) (revision e0f9892926cd7c2c3bf54a1e7d1d945a5c77e7ca) +++ library/lib/nxdoc-dc.tcl (.../nxdoc-dc.tcl) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -446,7 +446,7 @@ } foreach methodName [$box do [list $name info methods \ - -methodtype scripted \ + -type scripted \ -callprotection public]] { :readin \ -partof_entity $entity \ @@ -472,7 +472,7 @@ # methods foreach methodName [$box do [list ${name} {*}$scope info methods\ - -methodtype scripted \ + -type scripted \ -callprotection public]] { set tag [join [list {*}[expr {$scope eq "class"?"class-object":""}] method] -] Index: library/nx/nx.nxd =================================================================== diff -u -r5d1617640ad71fd52b069f81cfcadbe4cbb6f2a2 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- library/nx/nx.nxd (.../nx.nxd) (revision 5d1617640ad71fd52b069f81cfcadbe4cbb6f2a2) +++ library/nx/nx.nxd (.../nx.nxd) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -579,7 +579,7 @@ # the transitive relationships of the # class, i.e., by its superclasses # and transitive mixin classes. -# @parameter -methodtype Restrict the search by certain method +# @parameter -type Restrict the search by certain method # kinds: '''scripted''', '''builtin''', '''alias''', # '''forwarder''', '''object''', and '''setter'''. If # omitted, '''all''' method sorts are considered. @@ -1404,7 +1404,7 @@ # method population. This filter assumes # that mixin-provided methods should be # covered (see also '''-nomixins'''). -# @parameter -methodtype Restrict the search by certain method +# @parameter -type Restrict the search by certain method # kinds: '''scripted''', '''builtin''', '''alias''', # '''forwarder''', '''object''', and '''setter'''. If # omitted, '''all''' method sorts are considered. @@ -1506,7 +1506,7 @@ # @parameter -callprotection Restrict to the methods of a specific # call protection level: '''public''', '''protected''', # '''private''', or '''all'' (the latter is the default). -# @parameter -methodtype Restrict the search by certain method +# @parameter -type Restrict the search by certain method # kinds: '''scripted''', '''builtin''', '''alias''', # '''forwarder''', '''object''', and '''setter'''. If # omitted, '''all''' method sorts are considered. @@ -1688,7 +1688,7 @@ # @parameter -callprotection Restrict to the methods of a specific # call protection level: '''public''', '''protected''', # '''private''', or '''all''' (the latter is the default). -# @parameter -methodtype Restrict the search by certain method +# @parameter -type Restrict the search by certain method # kinds: '''scripted''', '''builtin''', '''alias''', # '''forwarder''', '''object''', and '''setter'''. If # omitted, '''all''' method sorts are considered. Index: library/nx/nx.tcl =================================================================== diff -u -r2d9fcf7f4dc9ccd8ac52702850f60724a04bcba4 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- library/nx/nx.tcl (.../nx.tcl) (revision 2d9fcf7f4dc9ccd8ac52702850f60724a04bcba4) +++ library/nx/nx.tcl (.../nx.tcl) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -531,7 +531,6 @@ # ... and remove it if found if {$p > -1} {set arguments [lreplace $arguments $p $p+1]} } - puts "::nsf::method::forward $(object) -per-object $(methodName) {*}$arguments" set r [::nsf::method::forward $(object) -per-object $(methodName) {*}$arguments] ::nsf::method::property $(object) -per-object $r call-protected \ [::nsf::dispatch $(object) __default_method_call_protection] @@ -831,7 +830,7 @@ ###################################################################### proc ::nx::internal::infoOptions {obj} { - #puts stderr "INFO INFO $obj -> '[::nsf::directdispatch $obj ::nsf::methods::object::info::methods -methodtype all]'" + #puts stderr "INFO INFO $obj -> '[::nsf::directdispatch $obj ::nsf::methods::object::info::methods -type all]'" set methods [list] foreach name [::nsf::directdispatch $obj ::nsf::methods::object::info::methods] { if {$name eq "unknown"} continue Index: library/serialize/serializer.tcl =================================================================== diff -u -r2872e1f0a6523c7fb44952492e05414c4f8d9c84 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- library/serialize/serializer.tcl (.../serializer.tcl) (revision 2872e1f0a6523c7fb44952492e05414c4f8d9c84) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -427,7 +427,7 @@ :public object method export_nsfprocs {ns} { set result "" foreach n [:application_namespaces $ns] { - foreach p [:info methods -methodtype nsfproc ${n}::*] { + foreach p [:info methods -type nsfproc ${n}::*] { append result [:info method definition $p] \n } } @@ -663,7 +663,7 @@ return [set $handle] } set needed [list] - foreach alias [$x ::nsf::methods::${where}::info::methods -methodtype alias -callprotection all -path] { + foreach alias [$x ::nsf::methods::${where}::info::methods -type alias -callprotection all -path] { set definition [$x ::nsf::methods::${where}::info::method definition $alias] set aliasedCmd [lindex $definition end] # @@ -915,13 +915,13 @@ :collect-var-traces $o $s append cmd [list [$o info class] create [::nsf::directdispatch $o -frame method ::nsf::current object]] append cmd " -noinit\n" - foreach i [$o ::nsf::methods::object::info::methods -methodtype scripted -callprotection all] { + foreach i [$o ::nsf::methods::object::info::methods -type scripted -callprotection all] { append cmd [:method-serialize $o $i ""] "\n" } - foreach i [$o ::nsf::methods::object::info::methods -methodtype forward -callprotection all] { + foreach i [$o ::nsf::methods::object::info::methods -type forward -callprotection all] { append cmd [concat [list $o] forward $i [$o info forward -definition $i]] "\n" } - foreach i [$o ::nsf::methods::object::info::methods -methodtype setter -callprotection all] { + foreach i [$o ::nsf::methods::object::info::methods -type setter -callprotection all] { append cmd [list $o parametercmd $i] "\n" } append cmd \ @@ -949,7 +949,7 @@ append cmd [list $o instparametercmd $i] "\n" } # provide limited support for exporting aliases for XOTcl objects - foreach i [$o ::nsf::methods::class::info::methods -methodtype alias -callprotection all] { + foreach i [$o ::nsf::methods::class::info::methods -type alias -callprotection all] { set nxDef [$o ::nsf::methods::class::info::method definition $i] append cmd [list ::nsf::method::alias $o {*}[lrange $nxDef 3 end]]\n } Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -rc291f4b6224e412028c70b33d227d352ce6eb7b9 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision c291f4b6224e412028c70b33d227d352ce6eb7b9) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -596,7 +596,7 @@ :alias class ::nsf::methods::object::info::class :alias children ::nsf::methods::object::info::children :proc commands {pattern:optional} { - set cmd [list ::nsf::methods::object::info::methods -methodtype all] + set cmd [list ::nsf::methods::object::info::methods -type all] if {[info exists pattern]} {lappend cmd $pattern} return [my {*}$cmd] } @@ -641,10 +641,10 @@ :proc methods { -nocmds:switch -noprocs:switch -nomixins:switch -incontext:switch pattern:optional } { - set methodtype all - if {$nocmds} {set methodtype scripted} - if {$noprocs} {if {$nocmds} {return ""}; set methodtype builtin} - set cmd [list ::nsf::methods::object::info::lookupmethods -methodtype $methodtype] + set type all + if {$nocmds} {set type scripted} + if {$noprocs} {if {$nocmds} {return ""}; set type builtin} + set cmd [list ::nsf::methods::object::info::lookupmethods -type $type] if {$nomixins} {lappend cmd -nomixins} if {$incontext} {lappend cmd -incontext} if {[info exists pattern]} {lappend cmd $pattern} @@ -665,7 +665,7 @@ :proc post {methodName} {my ::nsf::methods::object::info::method post $methodName} :proc pre {methodName} {my ::nsf::methods::object::info::method pre $methodName} :proc procs {pattern:optional} { - set cmd [list ::nsf::methods::object::info::methods -methodtype scripted] + set cmd [list ::nsf::methods::object::info::methods -type scripted] if {[info exists pattern]} {lappend cmd $pattern} return [my {*}$cmd] } @@ -735,7 +735,7 @@ return [my {*}$cmd] } :proc instparametercmd {pattern:optional} { - set cmd [list ::nsf::methods::class::info::methods -methodtype setter] + set cmd [list ::nsf::methods::class::info::methods -type setter] if {[info exists pattern]} {lappend cmd $pattern} return [my {*}$cmd] } @@ -744,7 +744,7 @@ :proc instpre {methodName} {my ::nsf::methods::class::info::method precondition $methodName} :proc instprocs {pattern:optional} { - set cmd [list ::nsf::methods::class::info::methods -methodtype scripted] + set cmd [list ::nsf::methods::class::info::methods -type scripted] if {[info exists pattern]} {lappend cmd $pattern} return [my {*}$cmd] } Index: tests/alias.test =================================================================== diff -u -rf858f142f5fab4f88996b3eb709c3afa55114be9 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- tests/alias.test (.../alias.test) (revision f858f142f5fab4f88996b3eb709c3afa55114be9) +++ tests/alias.test (.../alias.test) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -9,7 +9,7 @@ nx::Test case alias-preliminaries { # The system methods of nx::VariableSlot are either alias or forwarders - ? {lsort [::nx::VariableSlot info methods -methodtype alias]} {assign get} + ? {lsort [::nx::VariableSlot info methods -type alias]} {assign get} ? {::nx::VariableSlot info method definition get} \ "::nx::VariableSlot public alias get ::nsf::var::set" @@ -51,16 +51,16 @@ Foo create f1 ? {f1 foo} 1 ? {f1 foo -x 2} 2 - ? {Foo info methods -methodtype alias} "foo" + ? {Foo info methods -type alias} "foo" - ? {Base info methods -methodtype scripted} {foo} - ? {Foo info methods -methodtype scripted} {} - ? {Foo info methods -methodtype alias} {foo} + ? {Base info methods -type scripted} {foo} + ? {Foo info methods -type scripted} {} + ? {Foo info methods -type alias} {foo} Base public method foo {} {} #WITH_IMPORT_REFS - #? {Foo info methods -methodtype alias} "" - ? {Base info methods -methodtype scripted} {} - ? {Foo info methods -methodtype scripted} {} + #? {Foo info methods -type alias} "" + ? {Base info methods -type scripted} {} + ? {Foo info methods -type scripted} {} #WITH_IMPORT_REFS #? {Foo info method definition foo} "" ? {Foo info method definition foo} "::Foo public alias foo ::nsf::classes::Base::foo" @@ -69,11 +69,11 @@ Base public method foo {{-x 1}} {return $x} ::nsf::method::alias ::Foo foo ::nsf::classes::Base::foo - ? {Base info methods -methodtype scripted} {foo} "defined again" - ? {Foo info methods -methodtype alias} {foo} "aliased again" + ? {Base info methods -type scripted} {foo} "defined again" + ? {Foo info methods -type alias} {foo} "aliased again" Foo public method foo {} {} - ? {Base info methods -methodtype scripted} {foo} "still defined" - ? {Foo info methods -methodtype alias} {} "removed" + ? {Base info methods -type scripted} {foo} "still defined" + ? {Foo info methods -type alias} {} "removed" } nx::Test case alias-chaining { @@ -104,7 +104,7 @@ ::nsf::method::alias T FOO ::nsf::classes::T::foo ::nsf::method::alias S BAR ::nsf::classes::T::FOO - ? {T info methods -methodtype alias} "FOO" + ? {T info methods -type alias} "FOO" ? {T info method definition FOO} "::T public alias FOO ::nsf::classes::T::foo" ? {lsort [T info methods]} {FOO foo} ? {S info methods} {BAR} @@ -144,7 +144,7 @@ #WITH_IMPORT_REFS #? {T info methods} {foo} ? {T info methods} {foo FOO} - ? {lsort [T info object methods -methodtype alias]} {BAR FOO ZAP} + ? {lsort [T info object methods -type alias]} {BAR FOO ZAP} ? {lsort [T info object methods]} {BAR FOO ZAP bar} ? {t foo} ::T->foo ? {T info object method definition ZAP} {::T public object alias ZAP ::T::BAR} @@ -416,11 +416,11 @@ unset ::nsf::alias(::C,FOO,0) ? {info exists ::nsf::alias(::C,FOO,0)} 0 ? {C info method definition FOO} "" -? {C info methods -methodtype alias} FOO +? {C info methods -type alias} FOO rename ::foo "" #WITH_IMPORT_REFS -#? {C info methods -methodtype alias} "" -? {C info methods -methodtype alias} "FOO" +#? {C info methods -type alias} "" +? {C info methods -type alias} "FOO" ? {info exists ::nsf::alias(::C,FOO,0)} 0 ? {C info method definition FOO} "" @@ -438,13 +438,13 @@ ::nsf::method::alias C FOO ::foo ::nsf::method::alias C FOO2 ::foo ? {info exists ::nsf::alias(::C,FOO,0)} 1 -? {lsort [C info methods -methodtype alias]} {FOO FOO2} +? {lsort [C info methods -type alias]} {FOO FOO2} # Rename target, such that alias points to an invalid item # Note that removing the target works differently (makes cleanup) # rename ::foo "" rename ::foo ::foo2 ? {info exists ::nsf::alias(::C,FOO,0)} 1 -? {lsort [C info methods -methodtype alias]} {FOO FOO2} +? {lsort [C info methods -type alias]} {FOO FOO2} ? {c FOO} {target "::foo" of alias FOO apparently disappeared} ? {C info method definition FOO} "::C public alias FOO ::foo" unset ::nsf::alias(::C,FOO,0) Index: tests/forward.test =================================================================== diff -u -r2872e1f0a6523c7fb44952492e05414c4f8d9c84 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- tests/forward.test (.../forward.test) (revision 2872e1f0a6523c7fb44952492e05414c4f8d9c84) +++ tests/forward.test (.../forward.test) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -128,16 +128,16 @@ :public forward Info -methodprefix @ Info %1 %self } - ? {C info methods -methodtype forwarder} Info + ? {C info methods -type forwarder} Info C public forward XXXo x - ? {lsort [C info methods -methodtype forwarder]} [list Info XXXo] + ? {lsort [C info methods -type forwarder]} [list Info XXXo] - ? {C info methods -methodtype forwarder X*} [list XXXo] - ? {lsort [C info methods -methodtype forwarder *o]} [list Info XXXo] + ? {C info methods -type forwarder X*} [list XXXo] + ? {lsort [C info methods -type forwarder *o]} [list Info XXXo] # delete the forwarder C method XXXo {} {} - ? {C info methods -methodtype forwarder} [list Info] + ? {C info methods -type forwarder} [list Info] # get the definition of a instforwarder ? {C info method definition Info} [list ::C public forward Info -methodprefix @ Info %1 %self] @@ -150,7 +150,7 @@ :public object forward addOne expr 1 + } - ? {lsort [obj info object methods -methodtype forwarder]} "Mixin addOne foo i1" + ? {lsort [obj info object methods -type forwarder]} "Mixin addOne foo i1" ? {obj info object method definition Mixin} "::obj public object forward Mixin mixin %1 %self" ? {obj info object method definition addOne} "::obj public object forward addOne expr 1 +" ? {obj info object method definition foo} "::obj public object forward foo target %proc %self %%self %%p" Index: tests/info-method.test =================================================================== diff -u -rdf2936cf5ecc9a2d5473804c9b5e49b67fc02f50 -rd79efb10b92ad2045196990af50bc042e60b88f4 --- tests/info-method.test (.../info-method.test) (revision df2936cf5ecc9a2d5473804c9b5e49b67fc02f50) +++ tests/info-method.test (.../info-method.test) (revision d79efb10b92ad2045196990af50bc042e60b88f4) @@ -155,17 +155,17 @@ :public object method foo args {;} } - ? {lsort [MC info methods -methodtype scripted -callprotection public]} "foo" - ? {lsort [MC info methods -methodtype scripted -callprotection protected]} "bar1 bar2" - ? {lsort [MC info methods -methodtype scripted -callprotection all]} "bar1 bar2 foo" + ? {lsort [MC info methods -type scripted -callprotection public]} "foo" + ? {lsort [MC info methods -type scripted -callprotection protected]} "bar1 bar2" + ? {lsort [MC info methods -type scripted -callprotection all]} "bar1 bar2 foo" ::nsf::method::property ::MC foo call-protected true ::nsf::method::property ::MC bar2 call-protected false - ? {lsort [MC info methods -methodtype scripted -callprotection public]} "bar2" - ? {lsort [MC info methods -methodtype scripted -callprotection protected]} "bar1 foo" - ? {lsort [MC info methods -methodtype scripted -callprotection all]} "bar1 bar2 foo" + ? {lsort [MC info methods -type scripted -callprotection public]} "bar2" + ? {lsort [MC info methods -type scripted -callprotection protected]} "bar1 foo" + ? {lsort [MC info methods -type scripted -callprotection all]} "bar1 bar2 foo" ::nx::configure defaultMethodCallProtection false } @@ -677,14 +677,14 @@ # test "info method parameters" # ? {nx::Object info method parameters "info lookup methods"} \ - "-callprotection -incontext:switch -methodtype -nomixins:switch -path:switch -source pattern:optional" + "-callprotection -incontext:switch -type -nomixins:switch -path:switch -source pattern:optional" ? {nx::Object info method syntax "info lookup methods"} \ - "/cls/ info lookup methods ?-callprotection all|public|protected|private? ?-incontext? ?-methodtype all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ?-nomixins? ?-path? ?-source all|application|baseclasses? ?/pattern/?" + "/cls/ info lookup methods ?-callprotection all|public|protected|private? ?-incontext? ?-type all|scripted|builtin|alias|forwarder|object|setter|nsfproc? ?-nomixins? ?-path? ?-source all|application|baseclasses? ?/pattern/?" ? {o info object method parameters "foo b"} "x:int y:upper" ? {nx::Object info method parameters ::nx::Object::slot::__info::lookup::methods} \ - "-callprotection -incontext:switch -methodtype -nomixins:switch -path:switch -source pattern:optional" + "-callprotection -incontext:switch -type -nomixins:switch -path:switch -source pattern:optional" ? {o info object method parameters "::o::foo::b"} "x:int y:upper" ? {nx::Object info method registrationhandle "info"} "::nsf::classes::nx::Object::info"