Index: generic/nsfAPI.decls =================================================================== diff -u -r200af46a04ef0a09e4d27b6662a5a49b82c8ba52 -r7a1cdfcb9fbb66d49d824aa1c12547be59f590c2 --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision 200af46a04ef0a09e4d27b6662a5a49b82c8ba52) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision 7a1cdfcb9fbb66d49d824aa1c12547be59f590c2) @@ -96,7 +96,7 @@ # cmd "method::alias" NsfMethodAliasCmd { {-argName "object" -required 1 -type object} - {-argName "-per-object" -required 0 -nrargs 0} + {-argName "-per-object" -required 0 -nrargs 0 -type switch} {-argName "methodName" -required 1} {-argName "-frame" -required 0 -type "method|object|default" -default "default"} {-argName "cmdName" -required 1 -type tclobj} @@ -109,7 +109,7 @@ cmd "method::create" NsfMethodCreateCmd { {-argName "object" -required 1 -type object} {-argName "-inner-namespace" -nrargs 0} - {-argName "-per-object" -nrargs 0} + {-argName "-per-object" -required 0 -nrargs 0 -type switch} {-argName "-reg-object" -required 0 -type object} {-argName "methodName" -required 1 -type tclobj} {-argName "arguments" -required 1 -type tclobj} @@ -121,7 +121,7 @@ cmd method::asmcreate NsfAsmMethodCreateCmd { {-argName "object" -required 1 -type object} {-argName "-inner-namespace" -nrargs 0} - {-argName "-per-object" -nrargs 0} + {-argName "-per-object" -required 0 -nrargs 0 -type switch} {-argName "-reg-object" -required 0 -nrargs 1 -type object} {-argName "name" -required 1 -type tclobj} {-argName "arguments" -required 1 -type tclobj} @@ -130,12 +130,12 @@ cmd "method::delete" NsfMethodDeleteCmd { {-argName "object" -required 1 -type object} - {-argName "-per-object" -nrargs 0} + {-argName "-per-object" -required 0 -nrargs 0 -type switch} {-argName "methodName" -required 1 -type tclobj} } {-nxdoc 1} cmd "method::forward" NsfMethodForwardCmd { {-argName "object" -required 1 -type object} - {-argName "-per-object" -nrargs 0} + {-argName "-per-object" -required 0 -nrargs 0 -type switch} {-argName "method" -required 1 -type tclobj} {-argName "-default" -type tclobj} {-argName "-earlybinding" -nrargs 0} @@ -148,7 +148,7 @@ } {-nxdoc 1} cmd "method::property" NsfMethodPropertyCmd { {-argName "object" -required 1 -type object} - {-argName "-per-object" -nrargs 0} + {-argName "-per-object" -required 0 -nrargs 0 -type switch} {-argName "methodName" -required 1 -type tclobj} {-argName "methodproperty" -required 1 -type "class-only|call-private|call-protected|redefine-protected|returns|slotobj"} {-argName "value" -type tclobj} @@ -158,7 +158,7 @@ } {-nxdoc 1} cmd "method::setter" NsfMethodSetterCmd { {-argName "object" -required 1 -type object} - {-argName "-per-object" -nrargs 0} + {-argName "-per-object" -required 0 -nrargs 0 -type switch} {-argName "parameter" -required 1 -type tclobj} } {-nxdoc 1} Index: generic/nsfAPI.h =================================================================== diff -u -rc96782fabd01fbfc8d11365dcc649d2788f78aa3 -r7a1cdfcb9fbb66d49d824aa1c12547be59f590c2 --- generic/nsfAPI.h (.../nsfAPI.h) (revision c96782fabd01fbfc8d11365dcc649d2788f78aa3) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision 7a1cdfcb9fbb66d49d824aa1c12547be59f590c2) @@ -2742,7 +2742,7 @@ {"::nsf::method::asmcreate", NsfAsmMethodCreateCmdStub, 7, { {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, {"-inner-namespace", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-per-object", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"-reg-object", 0, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, {"name", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"arguments", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, @@ -2800,7 +2800,7 @@ }, {"::nsf::method::alias", NsfMethodAliasCmdStub, 5, { {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, - {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-per-object", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"methodName", NSF_ARG_REQUIRED, 1, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-frame", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToFrame, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"cmdName", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} @@ -2813,7 +2813,7 @@ {"::nsf::method::create", NsfMethodCreateCmdStub, 9, { {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, {"-inner-namespace", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-per-object", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"-reg-object", 0, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, {"methodName", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"arguments", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, @@ -2823,12 +2823,12 @@ }, {"::nsf::method::delete", NsfMethodDeleteCmdStub, 3, { {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, - {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-per-object", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"methodName", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, {"::nsf::method::forward", NsfMethodForwardCmdStub, 11, { {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, - {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-per-object", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"method", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-default", 0, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"-earlybinding", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, @@ -2841,7 +2841,7 @@ }, {"::nsf::method::property", NsfMethodPropertyCmdStub, 5, { {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, - {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-per-object", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"methodName", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"methodproperty", NSF_ARG_REQUIRED|NSF_ARG_IS_ENUMERATION, 1, ConvertToMethodproperty, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"value", 0, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} @@ -2851,7 +2851,7 @@ }, {"::nsf::method::setter", NsfMethodSetterCmdStub, 3, { {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, - {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-per-object", 0, 0, Nsf_ConvertToBoolean, NULL,NULL,"switch",NULL,NULL,NULL,NULL,NULL}, {"parameter", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, {"::nsf::my", NsfMyCmdStub, 5, { Index: tests/object-system.test =================================================================== diff -u -r3b5d2f4e0bc018420ebea39e54ad3212ade2a5bd -r7a1cdfcb9fbb66d49d824aa1c12547be59f590c2 --- tests/object-system.test (.../object-system.test) (revision 3b5d2f4e0bc018420ebea39e54ad3212ade2a5bd) +++ tests/object-system.test (.../object-system.test) (revision 7a1cdfcb9fbb66d49d824aa1c12547be59f590c2) @@ -224,6 +224,17 @@ ? {C create c2 {:method foo {} {;}}} ::c2 # +# check low level method creation on classes, and check C-level +# "-flag=value" handling +# +nsf::method::create ::C m1 {} {;} +? {lsort [::C ::nsf::methods::class::info::methods]} {m1 x y} +nsf::method::create ::C -per-object=false m2 {} {;} +? {lsort [::C ::nsf::methods::class::info::methods]} {m1 m2 x y} +nsf::method::create ::C -per-object=true m3 {} {;} +? {lsort [::C ::nsf::methods::object::info::methods]} {m3} + +# # tests for the dispatch command # nx::Object create o