Index: TODO =================================================================== diff -u -r1c14f3a105d396b9d3cc0c74a4ec3ae72261bac0 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- TODO (.../TODO) (revision 1c14f3a105d396b9d3cc0c74a4ec3ae72261bac0) +++ TODO (.../TODO) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -3424,8 +3424,9 @@ - nsf.c: small performance improvements - nsf.c: experimental implementation of ::nsf::method::dispatch +- renamed "nsf::method::dispatch" to "nsf::directdispatch" +- renamed "nsf::object::dispatch" to "nsf::dispatch" - TODO: - private: * document private in migration guide tutorial Index: generic/nsf.c =================================================================== diff -u -r1c14f3a105d396b9d3cc0c74a4ec3ae72261bac0 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- generic/nsf.c (.../nsf.c) (revision 1c14f3a105d396b9d3cc0c74a4ec3ae72261bac0) +++ generic/nsf.c (.../nsf.c) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -18166,15 +18166,15 @@ /* TODO: move me */ /* -cmd "method::dispatch" NsfMethodDispatchCmd { +cmd "directdispatch" NsfDirectDispatchCmd { {-argName "object" -required 1 -type object} {-argName "-frame" -required 0 -nrargs 1 -type "method|object|default" -default "default"} {-argName "command" -required 1 -type tclobj} {-argName "args" -type args} } */ static int -NsfMethodDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withFrame, +NsfDirectDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withFrame, Tcl_Obj *commandObj, int nobjc, Tcl_Obj *CONST nobjv[]) { int result; CONST char *methodName = ObjStr(commandObj); @@ -18275,7 +18275,7 @@ /* -cmd "object::dispatch" NsfObjectDispatchCmd { +cmd "dispatch" NsfDispatchCmd { {-argName "object" -required 1 -type object} {-argName "-intrinsic" -required 0 -nrargs 0} {-argName "-system" -required 0 -nrargs 0} @@ -18284,7 +18284,7 @@ } */ static int -NsfObjectDispatchCmd(Tcl_Interp *interp, NsfObject *object, +NsfDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withIntrinsic, int withSystem, Tcl_Obj *commandObj, int nobjc, Tcl_Obj *CONST nobjv[]) { int flags = NSF_CM_NO_UNKNOWN|NSF_CSC_IMMEDIATE|NSF_CM_IGNORE_PERMISSIONS|NSF_CM_NO_SHIFT; Index: generic/nsf.tcl =================================================================== diff -u -rcb838e0d7ecf616891cc1f5089750208913d8503 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- generic/nsf.tcl (.../nsf.tcl) (revision cb838e0d7ecf616891cc1f5089750208913d8503) +++ generic/nsf.tcl (.../nsf.tcl) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -5,9 +5,8 @@ # Symbols reused in the next scripting language namespace export \ - next current self configure finalize interp is my relation + next current self configure finalize interp is my relation dispatch - namespace eval ::nsf::object {namespace export dispatch} namespace eval ::nsf::method::create {namespace export alias} # Index: generic/nsfAPI.decls =================================================================== diff -u -r1c14f3a105d396b9d3cc0c74a4ec3ae72261bac0 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- generic/nsfAPI.decls (.../nsfAPI.decls) (revision 1c14f3a105d396b9d3cc0c74a4ec3ae72261bac0) +++ generic/nsfAPI.decls (.../nsfAPI.decls) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -30,6 +30,19 @@ cmd colon NsfColonCmd { {-argName "args" -type allargs} } +cmd "directdispatch" NsfDirectDispatchCmd { + {-argName "object" -required 1 -type object} + {-argName "-frame" -required 0 -type "method|object|default" -default "default"} + {-argName "command" -required 1 -type tclobj} + {-argName "args" -type args} +} +cmd "dispatch" NsfDispatchCmd { + {-argName "object" -required 1 -type object} + {-argName "-intrinsic" -required 0 -nrargs 0} + {-argName "-system" -required 0 -nrargs 0} + {-argName "command" -required 1 -type tclobj} + {-argName "args" -type args} +} cmd finalize NsfFinalizeCmd { {-argName "-keepvars" -required 0 -nrargs 0} } @@ -72,12 +85,6 @@ {-argName "-precondition" -type tclobj} {-argName "-postcondition" -type tclobj} } -cmd "method::dispatch" NsfMethodDispatchCmd { - {-argName "object" -required 1 -type object} - {-argName "-frame" -required 0 -type "method|object|default" -default "default"} - {-argName "command" -required 1 -type tclobj} - {-argName "args" -type args} -} cmd "method::delete" NsfMethodDeleteCmd { {-argName "object" -required 1 -type object} {-argName "-per-object" -nrargs 0} @@ -115,13 +122,6 @@ # # object cmds # -cmd "object::dispatch" NsfObjectDispatchCmd { - {-argName "object" -required 1 -type object} - {-argName "-intrinsic" -required 0 -nrargs 0} - {-argName "-system" -required 0 -nrargs 0} - {-argName "command" -required 1 -type tclobj} - {-argName "args" -type args} -} cmd "object::exists" NsfObjectExistsCmd { {-argName "value" -required 1 -type tclobj} } Index: generic/nsfAPI.h =================================================================== diff -u -r1c14f3a105d396b9d3cc0c74a4ec3ae72261bac0 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- generic/nsfAPI.h (.../nsfAPI.h) (revision 1c14f3a105d396b9d3cc0c74a4ec3ae72261bac0) +++ generic/nsfAPI.h (.../nsfAPI.h) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -237,6 +237,8 @@ static int NsfCurrentCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfDebugCompileEpochStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfDebugRunAssertionsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfDirectDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfFinalizeCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfInterpObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfInvalidateObjectParameterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -245,7 +247,6 @@ static int NsfMethodAssertionCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfMethodCreateCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfMethodDeleteCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int NsfMethodDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfMethodForwardCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfMethodPropertyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfMethodRegisteredCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -254,7 +255,6 @@ static int NsfNSCopyCmdsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfNSCopyVarsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfNextCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int NsfObjectDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjectExistsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjectPropertyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjectQualifyCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -334,6 +334,8 @@ static int NsfCurrentCmd(Tcl_Interp *interp, int currentoption); static int NsfDebugCompileEpoch(Tcl_Interp *interp); static int NsfDebugRunAssertionsCmd(Tcl_Interp *interp); +static int NsfDirectDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withFrame, Tcl_Obj *command, int nobjc, Tcl_Obj *CONST nobjv[]); +static int NsfDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withIntrinsic, int withSystem, Tcl_Obj *command, int nobjc, Tcl_Obj *CONST nobjv[]); static int NsfFinalizeCmd(Tcl_Interp *interp, int withKeepvars); static int NsfInterpObjCmd(Tcl_Interp *interp, CONST char *name, int objc, Tcl_Obj *CONST objv[]); static int NsfInvalidateObjectParameterCmd(Tcl_Interp *interp, NsfClass *class); @@ -342,7 +344,6 @@ static int NsfMethodAssertionCmd(Tcl_Interp *interp, NsfObject *object, int assertionsubcmd, Tcl_Obj *arg); static int NsfMethodCreateCmd(Tcl_Interp *interp, NsfObject *object, int withInner_namespace, int withPer_object, NsfObject *withReg_object, Tcl_Obj *methodName, Tcl_Obj *arguments, Tcl_Obj *body, Tcl_Obj *withPrecondition, Tcl_Obj *withPostcondition); static int NsfMethodDeleteCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName); -static int NsfMethodDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withFrame, Tcl_Obj *command, int nobjc, Tcl_Obj *CONST nobjv[]); static int NsfMethodForwardCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *method, Tcl_Obj *withDefault, int withEarlybinding, Tcl_Obj *withMethodprefix, int withObjframe, Tcl_Obj *withOnerror, int withVerbose, Tcl_Obj *target, int nobjc, Tcl_Obj *CONST nobjv[]); static int NsfMethodPropertyCmd(Tcl_Interp *interp, NsfObject *object, int withPer_object, Tcl_Obj *methodName, int methodproperty, Tcl_Obj *value); static int NsfMethodRegisteredCmd(Tcl_Interp *interp, Tcl_Obj *handle); @@ -351,7 +352,6 @@ static int NsfNSCopyCmdsCmd(Tcl_Interp *interp, Tcl_Obj *fromNs, Tcl_Obj *toNs); static int NsfNSCopyVarsCmd(Tcl_Interp *interp, Tcl_Obj *fromNs, Tcl_Obj *toNs); static int NsfNextCmd(Tcl_Interp *interp, Tcl_Obj *arguments); -static int NsfObjectDispatchCmd(Tcl_Interp *interp, NsfObject *object, int withIntrinsic, int withSystem, Tcl_Obj *command, int nobjc, Tcl_Obj *CONST nobjv[]); static int NsfObjectExistsCmd(Tcl_Interp *interp, Tcl_Obj *value); static int NsfObjectPropertyCmd(Tcl_Interp *interp, NsfObject *objectName, int objectproperty); static int NsfObjectQualifyCmd(Tcl_Interp *interp, Tcl_Obj *objectName); @@ -432,6 +432,8 @@ NsfCurrentCmdIdx, NsfDebugCompileEpochIdx, NsfDebugRunAssertionsCmdIdx, + NsfDirectDispatchCmdIdx, + NsfDispatchCmdIdx, NsfFinalizeCmdIdx, NsfInterpObjCmdIdx, NsfInvalidateObjectParameterCmdIdx, @@ -440,7 +442,6 @@ NsfMethodAssertionCmdIdx, NsfMethodCreateCmdIdx, NsfMethodDeleteCmdIdx, - NsfMethodDispatchCmdIdx, NsfMethodForwardCmdIdx, NsfMethodPropertyCmdIdx, NsfMethodRegisteredCmdIdx, @@ -449,7 +450,6 @@ NsfNSCopyCmdsCmdIdx, NsfNSCopyVarsCmdIdx, NsfNextCmdIdx, - NsfObjectDispatchCmdIdx, NsfObjectExistsCmdIdx, NsfObjectPropertyCmdIdx, NsfObjectQualifyCmdIdx, @@ -1071,6 +1071,49 @@ } static int +NsfDirectDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + ParseContext pc; + (void)clientData; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[NsfDirectDispatchCmdIdx].paramDefs, + method_definitions[NsfDirectDispatchCmdIdx].nrParameters, 1, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + NsfObject *object = (NsfObject *)pc.clientData[0]; + int withFrame = (int )PTR2INT(pc.clientData[1]); + Tcl_Obj *command = (Tcl_Obj *)pc.clientData[2]; + + assert(pc.status == 0); + return NsfDirectDispatchCmd(interp, object, withFrame, command, objc-pc.lastObjc, objv+pc.lastObjc); + + } +} + +static int +NsfDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + ParseContext pc; + (void)clientData; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[NsfDispatchCmdIdx].paramDefs, + method_definitions[NsfDispatchCmdIdx].nrParameters, 1, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + NsfObject *object = (NsfObject *)pc.clientData[0]; + int withIntrinsic = (int )PTR2INT(pc.clientData[1]); + int withSystem = (int )PTR2INT(pc.clientData[2]); + Tcl_Obj *command = (Tcl_Obj *)pc.clientData[3]; + + assert(pc.status == 0); + return NsfDispatchCmd(interp, object, withIntrinsic, withSystem, command, objc-pc.lastObjc, objv+pc.lastObjc); + + } +} + +static int NsfFinalizeCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; (void)clientData; @@ -1241,27 +1284,6 @@ } static int -NsfMethodDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - ParseContext pc; - (void)clientData; - - if (ArgumentParse(interp, objc, objv, NULL, objv[0], - method_definitions[NsfMethodDispatchCmdIdx].paramDefs, - method_definitions[NsfMethodDispatchCmdIdx].nrParameters, 1, - &pc) != TCL_OK) { - return TCL_ERROR; - } else { - NsfObject *object = (NsfObject *)pc.clientData[0]; - int withFrame = (int )PTR2INT(pc.clientData[1]); - Tcl_Obj *command = (Tcl_Obj *)pc.clientData[2]; - - assert(pc.status == 0); - return NsfMethodDispatchCmd(interp, object, withFrame, command, objc-pc.lastObjc, objv+pc.lastObjc); - - } -} - -static int NsfMethodForwardCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; (void)clientData; @@ -1428,28 +1450,6 @@ } static int -NsfObjectDispatchCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - ParseContext pc; - (void)clientData; - - if (ArgumentParse(interp, objc, objv, NULL, objv[0], - method_definitions[NsfObjectDispatchCmdIdx].paramDefs, - method_definitions[NsfObjectDispatchCmdIdx].nrParameters, 1, - &pc) != TCL_OK) { - return TCL_ERROR; - } else { - NsfObject *object = (NsfObject *)pc.clientData[0]; - int withIntrinsic = (int )PTR2INT(pc.clientData[1]); - int withSystem = (int )PTR2INT(pc.clientData[2]); - Tcl_Obj *command = (Tcl_Obj *)pc.clientData[3]; - - assert(pc.status == 0); - return NsfObjectDispatchCmd(interp, object, withIntrinsic, withSystem, command, objc-pc.lastObjc, objv+pc.lastObjc); - - } -} - -static int NsfObjectExistsCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { (void)clientData; @@ -2481,6 +2481,19 @@ {"::nsf::__db_run_assertions", NsfDebugRunAssertionsCmdStub, 0, { {NULL, 0, 0, NULL, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, +{"::nsf::directdispatch", NsfDirectDispatchCmdStub, 4, { + {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, + {"-frame", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToFrame, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"command", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"args", 0, 1, ConvertToNothing, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} +}, +{"::nsf::dispatch", NsfDispatchCmdStub, 5, { + {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, + {"-intrinsic", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"-system", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"command", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, + {"args", 0, 1, ConvertToNothing, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} +}, {"::nsf::finalize", NsfFinalizeCmdStub, 1, { {"-keepvars", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, @@ -2524,12 +2537,6 @@ {"-per-object", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, {"methodName", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::method::dispatch", NsfMethodDispatchCmdStub, 4, { - {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, - {"-frame", 0|NSF_ARG_IS_ENUMERATION, 1, ConvertToFrame, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"command", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"args", 0, 1, ConvertToNothing, 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}, @@ -2576,13 +2583,6 @@ {"::nsf::next", NsfNextCmdStub, 1, { {"arguments", 0, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, -{"::nsf::object::dispatch", NsfObjectDispatchCmdStub, 5, { - {"object", NSF_ARG_REQUIRED, 1, Nsf_ConvertToObject, NULL,NULL,"object",NULL,NULL,NULL,NULL,NULL}, - {"-intrinsic", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"-system", 0, 0, Nsf_ConvertToString, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"command", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}, - {"args", 0, 1, ConvertToNothing, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} -}, {"::nsf::object::exists", NsfObjectExistsCmdStub, 1, { {"value", NSF_ARG_REQUIRED, 1, Nsf_ConvertToTclobj, NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL}} }, Index: generic/predefined.h =================================================================== diff -u -rcb838e0d7ecf616891cc1f5089750208913d8503 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- generic/predefined.h (.../predefined.h) (revision cb838e0d7ecf616891cc1f5089750208913d8503) +++ generic/predefined.h (.../predefined.h) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -1,8 +1,7 @@ static char cmd[] = "namespace eval ::nsf {\n" "namespace export \\\n" -"next current self configure finalize interp is my relation\n" -"namespace eval ::nsf::object {namespace export dispatch}\n" +"next current self configure finalize interp is my relation dispatch\n" "namespace eval ::nsf::method::create {namespace export alias}\n" "proc ::nsf::method::provide {require_name definition {script \"\"}} {\n" "set ::nsf::methodIndex($require_name) [list definition $definition script $script]}\n" Index: library/lib/doc-tools.tcl =================================================================== diff -u -rfd3666742ed34091dbb93a872fe1d34d6b66ad9d -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision fd3666742ed34091dbb93a872fe1d34d6b66ad9d) +++ library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -1157,7 +1157,7 @@ # set prj [:current_project] set box [$prj sandbox] - set statement [list ::nsf::object::dispatch ${:name} \ + set statement [list ::nsf::dispatch ${:name} \ ::nsf::methods::class::info::objectparameter \ parametersyntax] :pinfo set bundle parametersyntax [$box eval $statement] @@ -2684,23 +2684,23 @@ # if {[::nsf::is class $cmd]} { - dict set bundle parametersyntax [::nsf::object::dispatch $cmd \ + dict set bundle parametersyntax [::nsf::dispatch $cmd \ ::nsf::methods::class::info::objectparameter \ parametersyntax] # # TODO: Are the parameters needed for objects??? # - # dict set bundle parameter [::nsf::object::dispatch $cmd \ + # dict set bundle parameter [::nsf::dispatch $cmd \ # ::nsf::methods::class::info::objectparameter \ # parameter] } } else { - if {![catch {set syntax [::nsf::object::dispatch $rootclass $infoMethod \ + if {![catch {set syntax [::nsf::dispatch $rootclass $infoMethod \ parametersyntax $cmd]} _]} { dict set bundle parametersyntax $syntax } - if {![catch {set pa [::nsf::object::dispatch $rootclass $infoMethod \ + if {![catch {set pa [::nsf::dispatch $rootclass $infoMethod \ parameter $cmd]} _]} { foreach pspec $pa { dict set bundle parameter {*}[::nx::doc::paraminfo {*}$pspec] @@ -2775,11 +2775,11 @@ set obj [::nsf::next]; set bundle [dict create] if {[info commands "::nx::Class"] ne ""} { - if {[::nsf::object::dispatch $obj ::nsf::methods::object::info::hastype ::nx::Slot]} { + if {[::nsf::dispatch $obj ::nsf::methods::object::info::hastype ::nx::Slot]} { dict set bundle objtype slot - dict set bundle incremental [expr {[::nsf::object::dispatch $obj ::nsf::methods::object::info::hastype ::nx::RelationSlot] || ([::nsf::object::dispatch $obj ::nsf::methods::object::info::hastype ::nx::VariableSlot] && [::nsf::var::exists $obj incremental] && [::nsf::var::set $obj incremental])}] + dict set bundle incremental [expr {[::nsf::dispatch $obj ::nsf::methods::object::info::hastype ::nx::RelationSlot] || ([::nsf::dispatch $obj ::nsf::methods::object::info::hastype ::nx::VariableSlot] && [::nsf::var::exists $obj incremental] && [::nsf::var::set $obj incremental])}] } - if {[::nsf::object::dispatch $obj ::nsf::methods::object::info::hastype ::nx::EnsembleObject]} { + if {[::nsf::dispatch $obj ::nsf::methods::object::info::hastype ::nx::EnsembleObject]} { dict set bundle objtype ensemble } dict set bundle ismetaclass [::nsf::is metaclass $obj] @@ -2823,19 +2823,19 @@ set scope object } - set handle [::nsf::object::dispatch $obj \ + set handle [::nsf::dispatch $obj \ ::nsf::methods::${scope}::info::method \ handle $leg] if {![::nsf::var::exists [::nsf::current class] handles] || ![[::nsf::current class] eval [concat dict exists \${:handles} $handle]]} { dict set bundle handle $handle dict set bundle handleinfo [::nx::doc::handleinfo $handle] - dict set bundle type [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::${scope}::info::method type $handle] - if {![catch {set pa [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::${scope}::info::method parameter $handle]} _]} { + dict set bundle type [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::${scope}::info::method type $handle] + if {![catch {set pa [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::${scope}::info::method parameter $handle]} _]} { foreach pspec $pa { dict set bundle parameter {*}[::nx::doc::paraminfo {*}$pspec] } } - if {![catch {set psyn [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::${scope}::info::method parametersyntax $handle]} _]} { + if {![catch {set psyn [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::${scope}::info::method parametersyntax $handle]} _]} { dict set bundle parametersyntax $psyn } ::nx::doc::__at_register_command $handle \ @@ -2854,7 +2854,7 @@ } } ::interp invokehidden "" proc ::nx::doc::handleinfo {handle} { - set definition [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method definition $handle] + set definition [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method definition $handle] if {$definition ne ""} { set obj [lindex $definition 0] set modifier [lindex $definition 2] @@ -2898,11 +2898,11 @@ set bundle [dict create] dict set bundle handle $handle dict set bundle handleinfo [::nx::doc::handleinfo $handle] - foreach pspec [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method parameter $handle] { + foreach pspec [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method parameter $handle] { dict set bundle parameter {*}[::nx::doc::paraminfo {*}$pspec] } - dict set bundle parametersyntax [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method parametersyntax $handle] - dict set bundle type [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method type $handle] + dict set bundle parametersyntax [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method parametersyntax $handle] + dict set bundle type [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method type $handle] dict set bundle returns [::nsf::method::property ${::nx::doc::rootns}::__Tracer $handle returns] ::nx::doc::__at_register_command $handle \ ->cmdtype @method \ @@ -2921,13 +2921,13 @@ dict set bundle handle $handle dict set bundle handleinfo [::nx::doc::handleinfo $handle] dict set bundle returns [::nsf::method::property ${::nx::doc::rootns}::__Tracer $handle returns] - dict set bundle type [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method type $handle] - if {![catch {set pa [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method parameter $handle]} _]} { + dict set bundle type [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method type $handle] + if {![catch {set pa [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method parameter $handle]} _]} { foreach pspec $pa { dict set bundle parameter {*}[::nx::doc::paraminfo {*}$pspec] } } - if {![catch {set psyn [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method parametersyntax $handle]} _]} { + if {![catch {set psyn [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method parametersyntax $handle]} _]} { dict set bundle parametersyntax $psyn } @@ -2976,8 +2976,8 @@ if {$handle ne ""} { dict set bundle handle $handle dict set bundle handleinfo [::nx::doc::handleinfo $handle] - dict set bundle type [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method type $handle] - if {![catch {set psyn [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method parametersyntax $handle]} _]} { + dict set bundle type [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method type $handle] + if {![catch {set psyn [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method parametersyntax $handle]} _]} { dict set bundle parametersyntax $psyn } @@ -2997,7 +2997,7 @@ if {$handle ne ""} { dict set bundle handle $handle dict set bundle handleinfo [::nx::doc::handleinfo $handle] - dict set bundle type [::nsf::object::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method type $handle] + dict set bundle type [::nsf::dispatch ${::nx::doc::rootns}::__Tracer ::nsf::methods::object::info::method type $handle] ::nx::doc::__at_register_command $handle \ ->cmdtype @method \ @@ -3422,7 +3422,7 @@ set prj [:current_project] if {$prj ne ""} { set box [$prj sandbox] - set script "if {\[::nsf::object::exists $obj\]} {array set \"\" \[$obj eval {:__resolve_method_path \"$method_name\"}\]; ::nsf::object::dispatch \$(object) ::nsf::methods::${scope}::info::method handle \$(methodName)}" + set script "if {\[::nsf::object::exists $obj\]} {array set \"\" \[$obj eval {:__resolve_method_path \"$method_name\"}\]; ::nsf::dispatch \$(object) ::nsf::methods::${scope}::info::method handle \$(methodName)}" set cmdname [$box do $script] if {$cmdname ne "" && [$box eval [concat dict exists \${:registered_commands} $cmdname]]} { :pdata [$box eval [concat dict get \${:registered_commands} $cmdname]] Index: library/nx/nx.tcl =================================================================== diff -u -rf9dbc318044af9e7cc6114171f0f06120b249ab5 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- library/nx/nx.tcl (.../nx.tcl) (revision f9dbc318044af9e7cc6114171f0f06120b249ab5) +++ library/nx/nx.tcl (.../nx.tcl) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -36,7 +36,7 @@ # get frequenly used primitiva from the next scripting framework # namespace export next current self configure finalize interp is my relation - namespace import ::nsf::next ::nsf::current ::nsf::self ::nsf::my ::nsf::object::dispatch + namespace import ::nsf::next ::nsf::current ::nsf::self ::nsf::my ::nsf::dispatch # # provide the standard command set for ::nx::Object @@ -122,7 +122,7 @@ #puts stderr ===nx118 set scope [expr {[::nsf::is class $object] && !${per-object} ? "class" : "object"}] #puts stderr ===nx119 - if {[::nsf::method::dispatch $object ::nsf::methods::${scope}::info::methods $w] eq ""} { + if {[::nsf::directdispatch $object ::nsf::methods::${scope}::info::methods $w] eq ""} { # # Create dispatch/ensemble object and accessor method (if wanted) # @@ -143,8 +143,8 @@ # The accessor method exists already, check, if it is # appropriate for extending. # - set type [::nsf::method::dispatch $object ::nsf::methods::${scope}::info::method type $w] - set definition [::nsf::method::dispatch $object ::nsf::methods::${scope}::info::method definition $w] + set type [::nsf::directdispatch $object ::nsf::methods::${scope}::info::method type $w] + set definition [::nsf::directdispatch $object ::nsf::methods::${scope}::info::method definition $w] if {$scope eq "class"} { if {$type ne "alias"} {error "can't append to $type"} if {$definition eq ""} {error "definition must not be empty"} @@ -190,7 +190,7 @@ if {$r ne ""} { # the method was not deleted ::nsf::method::property $(object) $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} } return $r @@ -211,7 +211,7 @@ if {$r ne ""} { # the method was not deleted ::nsf::method::property $(object) $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} } return $r @@ -308,7 +308,7 @@ } set r [::nsf::method::forward $(object) -per-object $(methodName) {*}$arguments] ::nsf::method::property $(object) -per-object $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} return $r } @@ -328,7 +328,7 @@ } set r [::nsf::method::forward $(object) $(methodName) {*}$arguments] ::nsf::method::property $(object) $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} return $r } @@ -345,7 +345,7 @@ set r [::nsf::method::alias $(object) -per-object $(methodName) \ -frame $frame $cmd] ::nsf::method::property $(object) -per-object $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} return $r } @@ -355,7 +355,7 @@ #puts "class alias $(object).$(methodName) $cmd" set r [::nsf::method::alias $(object) $(methodName) -frame $frame $cmd] ::nsf::method::property $(object) $r call-protected \ - [::nsf::object::dispatch $(object) __default_method_call_protection] + [::nsf::dispatch $(object) __default_method_call_protection] if {[info exists returns]} {::nsf::method::property $(object) $r returns $returns} return $r } @@ -391,7 +391,7 @@ return [::nsf::method::require [::nsf::self] $methodName 0] } namespace { - ::nsf::method::dispatch [::nsf::self] ::nsf::methods::object::requirenamespace + ::nsf::directdispatch [::nsf::self] ::nsf::methods::object::requirenamespace } } } @@ -625,17 +625,17 @@ # "package forget". We clear "info method" for ::nx::Object to avoid # confusions in the copy loop below, which uses method "method". # - if {[::nsf::method::dispatch ::nx::Object::slot::__info ::nsf::methods::object::info::methods "method"] ne ""} { + if {[::nsf::directdispatch ::nx::Object::slot::__info ::nsf::methods::object::info::methods "method"] ne ""} { Object method "info method" {} {} } # # Copy all info methods except the subobjects to # ::nx::Class::slot::__info # - foreach m [::nsf::method::dispatch ::nx::Object::slot::__info ::nsf::methods::object::info::methods] { - if {[::nsf::method::dispatch ::nx::Object::slot::__info ::nsf::methods::object::info::method type $m] eq "object"} continue - set definition [::nsf::method::dispatch ::nx::Object::slot::__info ::nsf::methods::object::info::method definition $m] + foreach m [::nsf::directdispatch ::nx::Object::slot::__info ::nsf::methods::object::info::methods] { + if {[::nsf::directdispatch ::nx::Object::slot::__info ::nsf::methods::object::info::method type $m] eq "object"} continue + set definition [::nsf::directdispatch ::nx::Object::slot::__info ::nsf::methods::object::info::method definition $m] ::nx::Class::slot::__info {*}[lrange $definition 1 end] unset definition } @@ -704,9 +704,9 @@ ###################################################################### proc ::nx::infoOptions {obj} { - #puts stderr "INFO INFO $obj -> '[::nsf::method::dispatch $obj ::nsf::methods::object::info::methods -methodtype all]'" + #puts stderr "INFO INFO $obj -> '[::nsf::directdispatch $obj ::nsf::methods::object::info::methods -methodtype all]'" set methods [list] - foreach name [::nsf::method::dispatch $obj ::nsf::methods::object::info::methods] { + foreach name [::nsf::directdispatch $obj ::nsf::methods::object::info::methods] { if {$name eq "unknown"} continue lappend methods $name } @@ -1041,7 +1041,7 @@ # Report just application specific methods not starting with "__" # set methods [list] - foreach m [::nsf::method::dispatch [::nsf::self] \ + foreach m [::nsf::directdispatch [::nsf::self] \ ::nsf::methods::object::info::lookupmethods -source application] { if {[string match __* $m]} continue lappend methods $m @@ -1199,7 +1199,7 @@ # Collect the object parameter slots in per-position lists to # ensure partial ordering and avoid sorting. # - foreach slot [nsf::method::dispatch [self] ::nsf::methods::class::info::slotobjects -closure -type ::nx::Slot] { + foreach slot [nsf::directdispatch [self] ::nsf::methods::class::info::slotobjects -closure -type ::nx::Slot] { lappend defs([$slot position]) [$slot getParameterSpec] } # @@ -1271,7 +1271,7 @@ if {![::nsf::object::exists $value]} { error "$value does not appear to be an object" } - set value [::nsf::method::dispatch $value -frame method ::nsf::self] + set value [::nsf::directdispatch $value -frame method ::nsf::self] } } set p [lsearch -exact $old $value] @@ -1392,28 +1392,28 @@ # ${os}::Object::slot::filter method guard {obj prop filter guard:optional} { if {[info exists guard]} { - ::nsf::method::dispatch $obj ::nsf::methods::object::filterguard $filter $guard + ::nsf::directdispatch $obj ::nsf::methods::object::filterguard $filter $guard } else { $obj info filter guard $filter } } ${os}::Class::slot::filter method guard {obj prop filter guard:optional} { if {[info exists guard]} { - ::nsf::method::dispatch $obj ::nsf::methods::class::filterguard $filter $guard + ::nsf::directdispatch $obj ::nsf::methods::class::filterguard $filter $guard } else { $obj info filter guard $filter } } ${os}::Object::slot::mixin method guard {obj prop mixin guard:optional} { if {[info exists guard]} { - ::nsf::method::dispatch $obj ::nsf::methods::object::mixinguard $mixin $guard + ::nsf::directdispatch $obj ::nsf::methods::object::mixinguard $mixin $guard } else { $obj info mixin guard $mixin } } ${os}::Class::slot::mixin method guard {obj prop filter guard:optional} { if {[info exists guard]} { - ::nsf::method::dispatch $obj ::nsf::methods::class::mixinguard $filter $guard + ::nsf::directdispatch $obj ::nsf::methods::class::mixinguard $filter $guard } else { $obj info mixin guard $filter } @@ -1550,7 +1550,7 @@ ::nsf::method::property ${:domain} \ {*}[expr {${:per-object} ? "-per-object" : ""}] \ $handle call-protected \ - [::nsf::object::dispatch ${:domain} __default_property_call_protection] + [::nsf::dispatch ${:domain} __default_property_call_protection] return 1 } @@ -1610,7 +1610,7 @@ ::nx::VariableSlot protected method handleTraces {} { # essentially like before set __initcmd "" - set trace {::nsf::method::dispatch [::nsf::self] -frame object ::trace} + set trace {::nsf::directdispatch [::nsf::self] -frame object ::trace} # There might be already default values registered on the # class. If so, defaultcmd is ignored. if {[info exists :default]} { @@ -1641,7 +1641,7 @@ # ::nx::VariableSlot method __default_from_cmd {obj cmd var sub op} { #puts "GETVAR [::nsf::current method] obj=$obj cmd=$cmd, var=$var, op=$op" - ::nsf::method::dispatch $obj -frame object \ + ::nsf::directdispatch $obj -frame object \ ::trace remove variable $var $op [list [::nsf::self] [::nsf::current method] $obj $cmd] ::nsf::var::set $obj $var [$obj eval $cmd] } @@ -1763,7 +1763,7 @@ if {$nocomplain} {$slot eval {set :nocomplain 1}} if {[info exists value]} {$slot setCheckedInstVar -nocomplain=$nocomplain $value} - return [::nsf::method::dispatch [self] ::nsf::methods::object::info::method handle [$slot name]] + return [::nsf::directdispatch [self] ::nsf::methods::object::info::method handle [$slot name]] } Object method property { @@ -1795,7 +1795,7 @@ -defaultopts [list -accessor $accessor -config $config] \ $spec \ {*}[expr {[info exists default] ? [list $default] : ""}]] - return [::nsf::method::dispatch [self] ::nsf::methods::class::info::method handle [$slot name]] + return [::nsf::directdispatch [self] ::nsf::methods::class::info::method handle [$slot name]] } nx::Class method property { @@ -1901,7 +1901,7 @@ if {![info exists object]} {set object [::nsf::self]} if {![::nsf::object::exists $object]} {$class create $object} # reused in XOTcl, no "require" there, so use nsf primitiva - ::nsf::method::dispatch $object ::nsf::methods::object::requirenamespace + ::nsf::directdispatch $object ::nsf::methods::object::requirenamespace if {$withnew} { set m [ScopedNew new -container $object -withclass $class] $m volatile @@ -1910,13 +1910,13 @@ # build xotcl and next objects. if {[::nsf::is class ::xotcl::Class]} {::xotcl::Class instmixin add $m end} #namespace eval $object $cmds - #::nsf::object::dispatch [self] -frame method ::apply [list {} $cmds $object] + #::nsf::directdispatch [self] -frame method ::apply [list {} $cmds $object] ::apply [list {} $cmds $object] Class mixin delete $m if {[::nsf::is class ::xotcl::Class]} {::xotcl::Class instmixin delete $m} } else { #namespace eval $object $cmds - #::nsf::object::dispatch [self] -frame method ::apply [list {} $cmds $object] + #::nsf::directdispatch [self] -frame method ::apply [list {} $cmds $object] ::apply [list {} $cmds $object] } } @@ -1936,7 +1936,7 @@ #puts stderr "COPY makeTargetList $t targetList '${:targetList}'" # if it is an object without namespace, it is a leaf if {[::nsf::object::exists $t]} { - if {[::nsf::method::dispatch $t ::nsf::methods::object::info::hasnamespace]} { + if {[::nsf::directdispatch $t ::nsf::methods::object::info::hasnamespace]} { # make target list from all children set children [$t info children] } else { @@ -2001,8 +2001,8 @@ ::nsf::relation $obj object-filter [::nsf::relation $origin object-filter] ::nsf::relation $obj object-mixin [::nsf::relation $origin object-mixin] # reused in XOTcl, no "require" there, so use nsf primitiva - if {[::nsf::method::dispatch $origin ::nsf::methods::object::info::hasnamespace]} { - ::nsf::method::dispatch $obj ::nsf::methods::object::requirenamespace + if {[::nsf::directdispatch $origin ::nsf::methods::object::info::hasnamespace]} { + ::nsf::directdispatch $obj ::nsf::methods::object::requirenamespace } } else { namespace eval $dest {} @@ -2037,7 +2037,7 @@ # transfer the traces # foreach var [$origin info vars] { - set cmds [::nsf::method::dispatch $origin -frame object ::trace info variable $var] + set cmds [::nsf::directdispatch $origin -frame object ::trace info variable $var] if {$cmds ne ""} { foreach cmd $cmds { foreach {op def} $cmd break @@ -2151,7 +2151,7 @@ ::nsf::method::create Object __default_method_call_protection args [list return $value] ::nsf::method::property Object __default_method_call_protection call-protected true } - return [::nsf::object::dispatch [::nx::self] __default_method_call_protection] + return [::nsf::dispatch [::nx::self] __default_method_call_protection] } # @@ -2164,7 +2164,7 @@ ::nsf::method::create Object __default_property_call_protection args [list return $value] ::nsf::method::property Object __default_property_call_protection call-protected true } - return [::nsf::object::dispatch [::nx::self] __default_property_call_protection] + return [::nsf::dispatch [::nx::self] __default_property_call_protection] } } # Index: library/serialize/serializer.tcl =================================================================== diff -u -rf9dbc318044af9e7cc6114171f0f06120b249ab5 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- library/serialize/serializer.tcl (.../serializer.tcl) (revision f9dbc318044af9e7cc6114171f0f06120b249ab5) +++ library/serialize/serializer.tcl (.../serializer.tcl) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -188,7 +188,7 @@ if {![::nsf::object::exists $o]} { return 0 } - set o [::nsf::object::dispatch $o ::nsf::methods::object::info::parent] + set o [::nsf::dispatch $o ::nsf::methods::object::info::parent] } } @@ -307,7 +307,7 @@ :public class method allChildren o { # return o and all its children fully qualified - set set [::nsf::method::dispatch $o -frame method ::nsf::current] + set set [::nsf::directdispatch $o -frame method ::nsf::current] foreach c [$o info children] { lappend set {*}[:allChildren $c] } @@ -522,13 +522,13 @@ # Handle association between objects and responsible serializers # :public method responsibleSerializer {object} { - return [::nsf::object::dispatch $object ::nsf::methods::object::info::hastype ${:rootClass}] + return [::nsf::dispatch $object ::nsf::methods::object::info::hastype ${:rootClass}] } :public method registerSerializer {s instances} { # Communicate responsibility to serializer object $s foreach i $instances { - if {![::nsf::object::dispatch $i ::nsf::methods::object::info::hastype ${:rootClass}]} continue + if {![::nsf::dispatch $i ::nsf::methods::object::info::hastype ${:rootClass}]} continue $s setObjectSystemSerializer $i [::nsf::current object] } } @@ -557,14 +557,14 @@ foreach {o p m} $k break if {![::nsf::object::exists $o]} { :warn "$o is not an object" - } elseif {[::nsf::object::dispatch $o ::nsf::methods::object::info::hastype ${:rootClass}]} { + } elseif {[::nsf::dispatch $o ::nsf::methods::object::info::hastype ${:rootClass}]} { set :exportMethods($k) 1 } } foreach o [Serializer exportedObjects] { if {![::nsf::object::exists $o]} { :warn "$o is not an object" - } elseif {[nsf::object::dispatch $o ::nsf::methods::object::info::hastype ${:rootClass}]} { + } elseif {[nsf::dispatch $o ::nsf::methods::object::info::hastype ${:rootClass}]} { set :exportObjects($o) 1 } } @@ -577,7 +577,7 @@ ############################### :method classify {o} { - if {[::nsf::object::dispatch $o ::nsf::methods::object::info::hastype ${:rootMetaClass}]} \ + if {[::nsf::dispatch $o ::nsf::methods::object::info::hastype ${:rootMetaClass}]} \ {return Class} {return Object} } @@ -783,7 +783,7 @@ } :collect-var-traces $o $s - set objectName [::nsf::method::dispatch $o -frame method ::nsf::current object] + set objectName [::nsf::directdispatch $o -frame method ::nsf::current object] set isSlotContainer [::nx::isSlotContainer $objectName] if {$isSlotContainer} { append cmd [list ::nx::slotObj [$o ::nsf::methods::object::info::parent]]\n @@ -922,7 +922,7 @@ :method Object-serialize {o s} { :collect-var-traces $o $s - append cmd [list [$o info class] create [::nsf::method::dispatch $o -frame method ::nsf::current object]] + 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] { append cmd [:method-serialize $o $i ""] "\n" Index: library/tcl-cool/tcl-cool.tcl =================================================================== diff -u -rc6057c18970d5bc19fe0f1f760ef0d29898ecfdd -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- library/tcl-cool/tcl-cool.tcl (.../tcl-cool.tcl) (revision c6057c18970d5bc19fe0f1f760ef0d29898ecfdd) +++ library/tcl-cool/tcl-cool.tcl (.../tcl-cool.tcl) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -113,7 +113,7 @@ # is created. First the object is allocated, then the constructor is called. # class method create {name args} { - set obj [::nsf::object::dispatch [self] ::nsf::methods::class::alloc $name] + set obj [::nsf::dispatch [self] ::nsf::methods::class::alloc $name] $obj init {*}$args return $obj } Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -rf9dbc318044af9e7cc6114171f0f06120b249ab5 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision f9dbc318044af9e7cc6114171f0f06120b249ab5) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -369,7 +369,7 @@ # ::xotcl::Class instproc objectparameter {} { set parameterdefinitions [list] - foreach slot [nsf::method::dispatch [self] ::nsf::methods::class::info::slotobjects -closure -type ::nx::Slot] { + foreach slot [nsf::directdispatch [self] ::nsf::methods::class::info::slotobjects -closure -type ::nx::Slot] { lappend parameterdefinitions [$slot getParameterSpec] } lappend parameterdefinitions args:alias,method=residualargs,args @@ -582,13 +582,13 @@ set guardsFlag [expr {$guards ? "-guards" : ""}] set patternArg [expr {[info exists pattern] ? [list $pattern] : ""}] if {$order && !$guards} { - set def [::nsf::method::dispatch [::nsf::current object] \ + set def [::nsf::directdispatch [::nsf::current object] \ ::nsf::methods::object::info::filtermethods -order \ {*}$guardsFlag \ {*}$patternArg] set def [method_handles_to_xotcl $def] } else { - set def [::nsf::method::dispatch [::nsf::current object] \ + set def [::nsf::directdispatch [::nsf::current object] \ ::nsf::methods::object::info::filtermethods \ {*}$guardsFlag \ {*}$patternArg] @@ -769,7 +769,7 @@ } Object instproc istype {class} { return [expr {[::nsf::is class $class] && - [::nsf::method::dispatch [self] ::nsf::methods::object::info::hastype $class]}] + [::nsf::directdispatch [self] ::nsf::methods::object::info::hastype $class]}] } # definition of "xotcl::Object contains", based on nx @@ -864,16 +864,16 @@ # support for XOTcl specific convenience routines Object instproc hasclass cl { if {![::nsf::is class $cl]} {return 0} - if {[::nsf::method::dispatch [self] ::nsf::methods::object::info::hasmixin $cl]} {return 1} - ::nsf::method::dispatch [self] ::nsf::methods::object::info::hastype $cl + if {[::nsf::directdispatch [self] ::nsf::methods::object::info::hasmixin $cl]} {return 1} + ::nsf::directdispatch [self] ::nsf::methods::object::info::hastype $cl } Object instproc filtersearch {filter} { - set handle [::nsf::method::dispatch [::nsf::current object] \ + set handle [::nsf::directdispatch [::nsf::current object] \ ::nsf::methods::object::info::lookupfilter $filter] return [method_handle_to_xotcl $handle] } Object instproc procsearch {name} { - set handle [::nsf::method::dispatch [::nsf::current object] \ + set handle [::nsf::directdispatch [::nsf::current object] \ ::nsf::methods::object::info::lookupmethod $name] return [method_handle_to_xotcl $handle] } @@ -1045,7 +1045,7 @@ } namespace eval [::xotcl::self] {namespace import ::xotcl::*} #namespace eval [::xotcl::self] $script - #::nsf::method::dispatch [::xotcl::self] -frame method ::apply [list {} $script [::xotcl::self]] + #::nsf::directdispatch [::xotcl::self] -frame method ::apply [list {} $script [::xotcl::self]] ::apply [list {} $script [::xotcl::self]] foreach e [set :export] { Index: tests/doc.test =================================================================== diff -u -ra24e1f836c3126d0a0e9467bde3a9fa8da901711 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- tests/doc.test (.../doc.test) (revision a24e1f836c3126d0a0e9467bde3a9fa8da901711) +++ tests/doc.test (.../doc.test) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -1101,7 +1101,7 @@ ::nsf::tmpdir ::nsf::assertion ::nsf::objectsystem::create - ::nsf::object::dispatch + ::nsf::dispatch ::nsf::var::exists ::nsf::exithandler ::nsf::forward Index: tests/interceptor-slot.test =================================================================== diff -u -rf9dbc318044af9e7cc6114171f0f06120b249ab5 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- tests/interceptor-slot.test (.../interceptor-slot.test) (revision f9dbc318044af9e7cc6114171f0f06120b249ab5) +++ tests/interceptor-slot.test (.../interceptor-slot.test) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -225,10 +225,10 @@ ? {c1 [A info method origin foo]} "A " # we expect same results via dispatch with fully qualified names - ? {nsf::object::dispatch c1 foo} "C B A " - ? {nsf::object::dispatch c1 [C info method origin foo]} "C B A " - ? {nsf::object::dispatch c1 [B info method origin foo]} "B A " - ? {nsf::object::dispatch c1 [A info method origin foo]} "A " + ? {nsf::dispatch c1 foo} "C B A " + ? {nsf::dispatch c1 [C info method origin foo]} "C B A " + ? {nsf::dispatch c1 [B info method origin foo]} "B A " + ? {nsf::dispatch c1 [A info method origin foo]} "A " # # check, whether the context of "my -local" is correct @@ -315,7 +315,7 @@ } X create c1 ? {c1 foo} "C B A X " - ? {nsf::object::dispatch c1 -intrinsic foo} "X " + ? {nsf::dispatch c1 -intrinsic foo} "X " # @@ -327,7 +327,7 @@ Z create c1 -mixin {C B A} ? {c1 foo} "C B A Z Y " - ? {nsf::object::dispatch c1 -intrinsic foo} "Z Y " + ? {nsf::dispatch c1 -intrinsic foo} "Z Y " # # check, whether the context of "my -intrinsic" is correct @@ -347,13 +347,13 @@ ? {c1 [Y info method origin bar]} "Z Y " # - # check, whether the context of "nsf::object::dispatch [self] -intrinsic" is correct + # check, whether the context of "nsf::dispatch [self] -intrinsic" is correct # - A public method bar {} {nsf::object::dispatch [self] -intrinsic foo} - B public method bar {} {nsf::object::dispatch [self] -intrinsic foo} - C public method bar {} {nsf::object::dispatch [self] -intrinsic foo} - Y public method bar {} {nsf::object::dispatch [self] -intrinsic foo} - Z public method bar {} {nsf::object::dispatch [self] -intrinsic foo} + A public method bar {} {nsf::dispatch [self] -intrinsic foo} + B public method bar {} {nsf::dispatch [self] -intrinsic foo} + C public method bar {} {nsf::dispatch [self] -intrinsic foo} + Y public method bar {} {nsf::dispatch [self] -intrinsic foo} + Z public method bar {} {nsf::dispatch [self] -intrinsic foo} ? {c1 bar} "Z Y " ? {c1 [C info method origin bar]} "Z Y " Index: tests/methods.test =================================================================== diff -u -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- tests/methods.test (.../methods.test) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) +++ tests/methods.test (.../methods.test) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -65,7 +65,7 @@ C public property s0 C protected property s1 ? {c1 s0 0} 0 -? {::nsf::object::dispatch c1 s1 1} 1 +? {::nsf::dispatch c1 s1 1} 1 C class property s3 ? {C s3 3} 3 @@ -76,31 +76,31 @@ ? {c2 plain_method} "plain_method" ? {c2 public_method} "public_method" ? {catch {c2 protected_method}} 1 - ? {::nsf::object::dispatch c2 protected_method} "protected_method" + ? {::nsf::dispatch c2 protected_method} "protected_method" } # class level forwards Test case class-level-forwards { ? {c2 plain_forward} "plain_method" ? {c2 public_forward} "public_method" ? {catch {c2 protected_forward}} 1 - ? {::nsf::object::dispatch c2 protected_forward} "protected_method" + ? {::nsf::dispatch c2 protected_forward} "protected_method" } # class level setter Test case class-level-setter { ? {c2 plain_setter 1} "1" ? {c2 public_setter 2} "2" ? {catch {c2 protected_setter 3}} 1 - ? {::nsf::object::dispatch c2 protected_setter 4} "4" + ? {::nsf::dispatch c2 protected_setter 4} "4" } # class level alias ....TODO: wanted behavior of [current method]? not "plain_alias"? Test case class-level-alias { ? {c2 plain_alias} "plain_method" ? {c2 public_alias} "public_method" ? {catch {c2 protected_alias}} 1 - ? {::nsf::object::dispatch c2 protected_alias} "protected_method" + ? {::nsf::dispatch c2 protected_alias} "protected_method" } ########### @@ -110,31 +110,31 @@ ? {C plain_object_method} "plain_object_method" ? {C public_object_method} "public_object_method" ? {catch {C protected_object_method}} 1 - ? {::nsf::object::dispatch C protected_object_method} "protected_object_method" + ? {::nsf::dispatch C protected_object_method} "protected_object_method" } # class level forwards Test case class-object-level-forwards { ? {C plain_object_forward} "plain_object_method" ? {C public_object_forward} "public_object_method" ? {catch {C protected_object_forward}} 1 - ? {::nsf::object::dispatch C protected_object_forward} "protected_object_method" + ? {::nsf::dispatch C protected_object_forward} "protected_object_method" } # class level setter Test case class-object-level-setter { ? {C plain_object_setter 1} "1" ? {C public_object_setter 2} "2" ? {catch {C protected_object_setter 3}} 1 - ? {::nsf::object::dispatch C protected_object_setter 4} "4" + ? {::nsf::dispatch C protected_object_setter 4} "4" } # class level alias ....TODO: wanted behavior of [current method]? not "plain_alias"? Test case class-object-level-alias { ? {C plain_object_alias} "plain_object_method" ? {C public_object_alias} "public_object_method" ? {catch {C protected_object_alias}} 1 - ? {::nsf::object::dispatch C protected_object_alias} "protected_object_method" + ? {::nsf::dispatch C protected_object_alias} "protected_object_method" } ########### @@ -144,31 +144,31 @@ ? {c1 plain_object_method} "plain_object_method" ? {c1 public_object_method} "public_object_method" ? {catch {c1 protected_object_method}} 1 - ? {::nsf::object::dispatch c1 protected_object_method} "protected_object_method" + ? {::nsf::dispatch c1 protected_object_method} "protected_object_method" } # object level forwards Test case object-level-forwards { ? {c1 plain_object_forward} "plain_object_method" ? {c1 public_object_forward} "public_object_method" ? {catch {c1 protected_object_forward}} 1 - ? {::nsf::object::dispatch c1 protected_object_forward} "protected_object_method" + ? {::nsf::dispatch c1 protected_object_forward} "protected_object_method" } # object level setter Test case object-level-setter { ? {c1 plain_object_setter 1} "1" ? {c1 public_object_setter 2} "2" ? {catch {c1 protected_object_setter 3}} 1 - ? {::nsf::object::dispatch c1 protected_object_setter 4} "4" + ? {::nsf::dispatch c1 protected_object_setter 4} "4" } # object level alias ....TODO: wanted behavior of [current method]? not "plain_alias"? Test case object-level-alias { ? {c1 plain_object_alias} "plain_object_method" ? {c1 public_object_alias} "public_object_method" ? {catch {c1 protected_object_alias}} 1 - ? {::nsf::object::dispatch c1 protected_object_alias} "protected_object_method" + ? {::nsf::dispatch c1 protected_object_alias} "protected_object_method" ? {lsort [c1 info methods]} \ "plain_object_alias plain_object_forward plain_object_method plain_object_setter public_object_alias public_object_forward public_object_method public_object_setter" Index: tests/object-system.test =================================================================== diff -u -rf9dbc318044af9e7cc6114171f0f06120b249ab5 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- tests/object-system.test (.../object-system.test) (revision f9dbc318044af9e7cc6114171f0f06120b249ab5) +++ tests/object-system.test (.../object-system.test) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -159,20 +159,20 @@ o method bar {x} {return goo-$x} # dispatch without colon names -::nsf::object::dispatch o eval set :x 1 +::nsf::dispatch o eval set :x 1 ? {o info vars} x "simple dispatch has set variable x" ? {::nx::var set o x} 1 "simple dispatch has set variable x to 1" -? {::nsf::object::dispatch o foo} "goo" "simple dispatch with one arg works" -? {::nsf::object::dispatch o bar 1} "goo-1" "simple dispatch with two args works" +? {::nsf::dispatch o foo} "goo" "simple dispatch with one arg works" +? {::nsf::dispatch o bar 1} "goo-1" "simple dispatch with two args works" o destroy # dispatch with colon names Object create o {set :x 1} -::nsf::object::dispatch ::o ::incr x +::nsf::dispatch ::o ::incr x ? {o eval {set :x}} 1 "cmd dispatch without -frame object did not modify the instance variable" -::nsf::method::dispatch ::o -frame object ::incr x +::nsf::directdispatch ::o -frame object ::incr x ? {o eval {set :x}} 2 "cmd dispatch -frame object modifies the instance variable" -? {catch {::nsf::object::dispatch ::o -frame object ::xxx x}} 1 "cmd dispatch with unknown command" +? {catch {::nsf::dispatch ::o -frame object ::xxx x}} 1 "cmd dispatch with unknown command" o destroy Object create o { @@ -183,9 +183,9 @@ return $results } } -::nsf::method::dispatch o ::eval {set x1 1; set :y1 1} -::nsf::method::dispatch o -frame method ::eval {set x2 1; set :y2 1} -::nsf::method::dispatch o -frame object ::eval {set x3 1; set :y3 1} +::nsf::directdispatch o ::eval {set x1 1; set :y1 1} +::nsf::directdispatch o -frame method ::eval {set x2 1; set :y2 1} +::nsf::directdispatch o -frame object ::eval {set x3 1; set :y3 1} ? {o foo} "x1 0 y1 0 x2 0 y2 1 x3 1 y3 1" o destroy Index: tests/parameters.test =================================================================== diff -u -rce55b9f6e80b8444dd248b1e6e36217716331ee9 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- tests/parameters.test (.../parameters.test) (revision ce55b9f6e80b8444dd248b1e6e36217716331ee9) +++ tests/parameters.test (.../parameters.test) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -76,7 +76,7 @@ ? {c1 info has type C1} {expected class but got "C1" for parameter "class"} ? {c1 ::nsf::methods::object::info::hastype C} 1 - ? {::nsf::object::dispatch c1 ::nsf::methods::object::info::hastype C} 1 + ? {::nsf::dispatch c1 ::nsf::methods::object::info::hastype C} 1 ? {::nsf::is object o1} 1 ? {::nsf::is object o100} 0 @@ -1342,9 +1342,9 @@ Test case checktype { nx::Object create o { - :public method f01 {} {::nsf::object::dispatch o ::nsf::methods::object::info::hastype ::nx::Object} - :public method f02 {} {::nsf::object::dispatch o ::nsf::methods::object::info::hastype nx::Object} - :public method f03 {} {::nsf::object::dispatch o ::nsf::methods::object::info::hastype Object} + :public method f01 {} {::nsf::dispatch o ::nsf::methods::object::info::hastype ::nx::Object} + :public method f02 {} {::nsf::dispatch o ::nsf::methods::object::info::hastype nx::Object} + :public method f03 {} {::nsf::dispatch o ::nsf::methods::object::info::hastype Object} :public method f11 {} {::nsf::is object,type=::nx::Object o} :public method f12 {} {::nsf::is object,type=nx::Object o} @@ -1366,18 +1366,18 @@ namespace eval foo { nx::Class create C { :create c1 - :public method f21 {} {::nsf::object::dispatch c1 ::nsf::methods::object::info::hastype Object} - :public method f22 {} {::nsf::object::dispatch c1 ::nsf::methods::object::info::hastype C} + :public method f21 {} {::nsf::dispatch c1 ::nsf::methods::object::info::hastype Object} + :public method f22 {} {::nsf::dispatch c1 ::nsf::methods::object::info::hastype C} :public method f31 {} {::nsf::is object,type=Object c1} :public method f32 {} {::nsf::is object,type=C c1} } nx::Object create o { - :public method f01 {} {::nsf::object::dispatch c1 ::nsf::methods::object::info::hastype ::nx::Object} - :public method f02 {} {::nsf::object::dispatch c1 ::nsf::methods::object::info::hastype nx::Object} - :public method f03 {} {::nsf::object::dispatch c1 ::nsf::methods::object::info::hastype Object} - :public method f04 {} {::nsf::object::dispatch c1 ::nsf::methods::object::info::hastype foo::C} - :public method f05 {} {::nsf::object::dispatch c1 ::nsf::methods::object::info::hastype C} + :public method f01 {} {::nsf::dispatch c1 ::nsf::methods::object::info::hastype ::nx::Object} + :public method f02 {} {::nsf::dispatch c1 ::nsf::methods::object::info::hastype nx::Object} + :public method f03 {} {::nsf::dispatch c1 ::nsf::methods::object::info::hastype Object} + :public method f04 {} {::nsf::dispatch c1 ::nsf::methods::object::info::hastype foo::C} + :public method f05 {} {::nsf::dispatch c1 ::nsf::methods::object::info::hastype C} :public method f11 {} {::nsf::is object,type=::nx::Object c1} :public method f12 {} {::nsf::is object,type=nx::Object c1} Index: tests/tcloo.test =================================================================== diff -u -rb2ab5886fc3278e549bb2772dfce921fbd06a9e9 -r8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf --- tests/tcloo.test (.../tcloo.test) (revision b2ab5886fc3278e549bb2772dfce921fbd06a9e9) +++ tests/tcloo.test (.../tcloo.test) (revision 8046b1da6bc0689f73d4dbdc3f8d1e03fd23acaf) @@ -43,7 +43,7 @@ nsf::proc methodExport {current {-perObject:switch false} {-callProtected:switch false} args} { set scope [expr {$perObject?"object":"class"}] foreach m $args { - set methodHandle [::nsf::object::dispatch $current \ + set methodHandle [::nsf::dispatch $current \ ::nsf::methods::${scope}::info::method handle $m] if {$methodHandle eq ""} { set methodHandle [::nsf::method::create $current {*}[expr {$perObject?"-per-object":""}] $m args { @@ -77,7 +77,7 @@ nx::Class create ExportUnexportUtil { :public method class {what args} { if {$what in {export unexport}} { - return [::nsf::object::dispatch [current] ::nsf::classes::nx::Object::$what {*}$args] + return [::nsf::dispatch [current] ::nsf::classes::nx::Object::$what {*}$args] } ::nsf::next }