Index: TODO =================================================================== diff -u -r3a0d180d2de8a7d03adb2aa57eb865e83dae7d68 -r27e11788125901ff468955117d165f70d3871ce0 --- TODO (.../TODO) (revision 3a0d180d2de8a7d03adb2aa57eb865e83dae7d68) +++ TODO (.../TODO) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -1323,6 +1323,9 @@ aliases to objects - removed some obsolete functions +- changed "info available" into "info lookup" + (and accordingly c definitions) + TODO: - check equivalence of the following two commands Index: doc/next-migration.html =================================================================== diff -u -r99ee1ab0e5d0d04de1dc14cf190b27a0ce9edfcf -r27e11788125901ff468955117d165f70d3871ce0 --- doc/next-migration.html (.../next-migration.html) (revision 99ee1ab0e5d0d04de1dc14cf190b27a0ce9edfcf) +++ doc/next-migration.html (.../next-migration.html) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -956,14 +956,14 @@ XOTclNext Scripting Language obj info methods ?pattern? - obj info callable methods ... ?pattern?
+ obj info lookup methods ... ?pattern?
# Returns list of method names
n.a. # List only application specific methods
- obj info callable methods -application ... ?pattern?
+ obj info lookup methods -application ... ?pattern?
# Returns list of method names
@@ -975,7 +975,7 @@ # -nomixins
- # Options for 'info callable + # Options for 'info lookup methods'
#
# -application
@@ -986,6 +986,14 @@
+ + + n.a. + # List slot objects defined for obj
+ obj info lookup slots
+ # Returns list of slot objects +
+

List object/class where some method is defined

@@ -994,12 +1002,12 @@ XOTclNext Scripting Language obj procsearch methodName - obj info callable method methodName
+ obj info lookup method methodName
# Returns method-handle
obj filtersearch methodName - obj info callable filter methodName
+ obj info lookup filter methodName
# Returns method-handle
@@ -1436,6 +1444,6 @@
- Last modified: Thu Sep 9 08:48:22 CEST 2010 + Last modified: Fri Sep 10 10:36:34 CEST 2010 Index: doc/tutorial2.html =================================================================== diff -u -r9a128ffc80f0c429d885af38e92c50b253cdb9e8 -r27e11788125901ff468955117d165f70d3871ce0 --- doc/tutorial2.html (.../tutorial2.html) (revision 9a128ffc80f0c429d885af38e92c50b253cdb9e8) +++ doc/tutorial2.html (.../tutorial2.html) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -1956,7 +1956,7 @@ Class NoClassInfo -superclass Class # redefine info ability NoClassInfo instproc info args { - error "No class info available" + error "No class info lookup" } # derive agent class from meta-class, which # can not access class info Index: generic/gentclAPI.decls =================================================================== diff -u -r88ce4132aeb39289918426aa2c285c354a102a1e -r27e11788125901ff468955117d165f70d3871ce0 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 88ce4132aeb39289918426aa2c285c354a102a1e) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -214,23 +214,6 @@ # # info object methods # -objectInfoMethod callablefilter NsfObjInfoCallableFilterMethod { - {-argName "filter"} -} -objectInfoMethod callablemethod NsfObjInfoCallableMethodMethod { - {-argName "name"} -} -objectInfoMethod callablemethods NsfObjInfoCallableMethodsMethod { - {-argName "-methodtype" -nrargs 1 -type "all|scripted|builtin|alias|forwarder|object|setter"} - {-argName "-callprotection" -nrargs 1 -type "all|protected|public" -default all} - {-argName "-application"} - {-argName "-nomixins"} - {-argName "-incontext"} - {-argName "pattern" -required 0} -} -objectInfoMethod callableslots NsfObjInfoCallableSlotsMethod { - {-argName "-type" -required 0 -nrargs 1 -type class} -} objectInfoMethod children NsfObjInfoChildrenMethod { {-argName "-type" -required 0 -nrargs 1 -type class} {-argName "pattern" -required 0} @@ -260,6 +243,23 @@ objectInfoMethod is NsfObjInfoIsMethod { {-argName "objectkind" -type "class|baseclass|metaclass"} } +objectInfoMethod lookupfilter NsfObjInfoLookupFilterMethod { + {-argName "filter"} +} +objectInfoMethod lookupmethod NsfObjInfoLookupMethodMethod { + {-argName "name"} +} +objectInfoMethod lookupmethods NsfObjInfoLookupMethodsMethod { + {-argName "-methodtype" -nrargs 1 -type "all|scripted|builtin|alias|forwarder|object|setter"} + {-argName "-callprotection" -nrargs 1 -type "all|protected|public" -default all} + {-argName "-application"} + {-argName "-nomixins"} + {-argName "-incontext"} + {-argName "pattern" -required 0} +} +objectInfoMethod lookupslots NsfObjInfoLookupSlotsMethod { + {-argName "-type" -required 0 -nrargs 1 -type class} +} objectInfoMethod method NsfObjInfoMethodMethod { {-argName "infomethodsubcmd" -type "args|body|definition|handle|parameter|parametersyntax|type|precondition|postcondition"} {-argName "name"} Index: generic/nsf.c =================================================================== diff -u -r3a0d180d2de8a7d03adb2aa57eb865e83dae7d68 -r27e11788125901ff468955117d165f70d3871ce0 --- generic/nsf.c (.../nsf.c) (revision 3a0d180d2de8a7d03adb2aa57eb865e83dae7d68) +++ generic/nsf.c (.../nsf.c) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -14027,13 +14027,139 @@ /*************************** * Begin Object Info Methods ***************************/ + /* -objectInfoMethod callablefilter NsfObjInfoCallableFilterMethod { +objectInfoMethod children NsfObjInfoChildrenMethod { + {-argName "-type" -required 0 -nrargs 1 -type class} + {-argName "pattern" -required 0} +} +*/ +static int +NsfObjInfoChildrenMethod(Tcl_Interp *interp, NsfObject *object, NsfClass *type, CONST char *pattern) { + return ListChildren(interp, object, pattern, 0, type); +} + +/* +objectInfoMethod class NsfObjInfoClassMethod { +} +*/ +static int +NsfObjInfoClassMethod(Tcl_Interp *interp, NsfObject *object) { + Tcl_SetObjResult(interp, object->cl->object.cmdName); + return TCL_OK; +} + +/* +objectInfoMethod filterguard NsfObjInfoFilterguardMethod { + {-argName "filter" -required 1} +} +*/ +static int +NsfObjInfoFilterguardMethod(Tcl_Interp *interp, NsfObject *object, CONST char *filter) { + return object->opt ? GuardList(interp, object->opt->filters, filter) : TCL_OK; +} + +/* +objectInfoMethod filtermethods NsfObjInfoFiltermethodsMethod { + {-argName "-guards"} + {-argName "-order"} + {-argName "pattern"} +} +*/ +static int +NsfObjInfoFiltermethodsMethod(Tcl_Interp *interp, NsfObject *object, + int withGuards, int withOrder, + CONST char *pattern) { + NsfObjectOpt *opt = object->opt; + + if (withOrder) { + if (!(object->flags & NSF_FILTER_ORDER_VALID)) + FilterComputeDefined(interp, object); + return FilterInfo(interp, object->filterOrder, pattern, withGuards, 1); + } + return opt ? FilterInfo(interp, opt->filters, pattern, withGuards, 0) : TCL_OK; +} + +/* +objectInfoMethod forward NsfObjInfoForwardMethod { + {-argName "-definition"} + {-argName "name"} +} +*/ +static int +NsfObjInfoForwardMethod(Tcl_Interp *interp, NsfObject *object, int withDefinition, CONST char *pattern) { + return object->nsPtr ? + ListForward(interp, Tcl_Namespace_cmdTable(object->nsPtr), pattern, withDefinition) : + TCL_OK; +} + +/* +objectInfoMethod hasmixin NsfObjInfoHasMixinMethod { + {-argName "class" -type class} +} +*/ +static int +NsfObjInfoHasMixinMethod(Tcl_Interp *interp, NsfObject *object, NsfClass *mixinClass) { + Tcl_SetBooleanObj(Tcl_GetObjResult(interp), HasMixin(interp, object, mixinClass)); + return TCL_OK; +} + +/* +objectInfoMethod hasnamespace NsfObjInfoHasnamespaceMethod { +} +*/ +static int +NsfObjInfoHasnamespaceMethod(Tcl_Interp *interp, NsfObject *object) { + Tcl_SetBooleanObj(Tcl_GetObjResult(interp), object->nsPtr != NULL); + return TCL_OK; +} + +/* +objectInfoMethod hastype NsfObjInfoHasTypeMethod { + {-argName "class" -type class} +} +*/ +static int +NsfObjInfoHasTypeMethod(Tcl_Interp *interp, NsfObject *object, NsfClass *typeClass) { + Tcl_SetBooleanObj(Tcl_GetObjResult(interp), IsSubType(object->cl, typeClass)); + return TCL_OK; +} + +/* +objectInfoMethod is NsfObjInfoIsMethod { + {-argName "objectkind" -type "class|baseclass|metaclass"} +} +*/ +static int +NsfObjInfoIsMethod(Tcl_Interp *interp, NsfObject *object, int objectkind) { + int success = 0; + + switch (objectkind) { + case ObjectkindClassIdx: + success = (NsfObjectIsClass(object) > 0); + break; + + case ObjectkindMetaclassIdx: + success = NsfObjectIsClass(object) + && IsMetaClass(interp, (NsfClass*)object, 1); + break; + + case ObjectkindBaseclassIdx: + success = NsfObjectIsClass(object) + && IsBaseClass((NsfClass*)object); + break; + } + Tcl_SetIntObj(Tcl_GetObjResult(interp), success); + return TCL_OK; +} + +/* +objectInfoMethod lookupfilter NsfObjInfoLookupFilterMethod { {-argName "filter"} } */ static int -NsfObjInfoCallableFilterMethod(Tcl_Interp *interp, NsfObject *object, CONST char *filter) { +NsfObjInfoLookupFilterMethod(Tcl_Interp *interp, NsfObject *object, CONST char *filter) { CONST char *filterName; NsfCmdList *cmdList; NsfClass *fcl; @@ -14063,12 +14189,12 @@ } /* -objectInfoMethod callablemethod NsfObjInfoCallableMethodMethod { +objectInfoMethod lookupmethod NsfObjInfoLookupMethodMethod { {-argName "pattern" -required 0} } */ static int -NsfObjInfoCallableMethodMethod(Tcl_Interp *interp, NsfObject *object, CONST char *name) { +NsfObjInfoLookupMethodMethod(Tcl_Interp *interp, NsfObject *object, CONST char *name) { NsfClass *pcl = NULL; Tcl_Command cmd = ObjectFindMethod(interp, object, name, &pcl); @@ -14081,7 +14207,7 @@ } /* -objectInfoMethod callablemethods NsfObjInfoCallableMethodsMethod { +objectInfoMethod lookupmethods NsfObjInfoLookupMethodsMethod { {-argName "-methodtype" -nrargs 1 -type "all|scripted|builtin|alias|forwarder|object|setter"} {-argName "-callprotection" -nrargs 1 -type "all|protected|public" -default all} {-argName "-application"} @@ -14091,7 +14217,7 @@ } */ static int -NsfObjInfoCallableMethodsMethod(Tcl_Interp *interp, NsfObject *object, +NsfObjInfoLookupMethodsMethod(Tcl_Interp *interp, NsfObject *object, int withMethodtype, int withCallprotection, int withApplication, int withNomixins, int withIncontext, CONST char *pattern) { @@ -14161,12 +14287,12 @@ } /* -objectInfoMethod callableslots NsfObjInfoCallableSlotsMethod { +objectInfoMethod lookupslots NsfObjInfoLookupSlotsMethod { {-argName "-type" -required 0 -nrargs 1 -type class} } */ static int -NsfObjInfoCallableSlotsMethod(Tcl_Interp *interp, NsfObject *object, NsfClass *type) { +NsfObjInfoLookupSlotsMethod(Tcl_Interp *interp, NsfObject *object, NsfClass *type) { NsfObjects *pl, *slotObjects; Tcl_Obj *list = Tcl_NewListObj(0, NULL); @@ -14180,133 +14306,7 @@ return TCL_OK; } - /* -objectInfoMethod children NsfObjInfoChildrenMethod { - {-argName "-type" -required 0 -nrargs 1 -type class} - {-argName "pattern" -required 0} -} -*/ -static int -NsfObjInfoChildrenMethod(Tcl_Interp *interp, NsfObject *object, NsfClass *type, CONST char *pattern) { - return ListChildren(interp, object, pattern, 0, type); -} - -/* -objectInfoMethod class NsfObjInfoClassMethod { -} -*/ -static int -NsfObjInfoClassMethod(Tcl_Interp *interp, NsfObject *object) { - Tcl_SetObjResult(interp, object->cl->object.cmdName); - return TCL_OK; -} - -/* -objectInfoMethod filterguard NsfObjInfoFilterguardMethod { - {-argName "filter" -required 1} -} -*/ -static int -NsfObjInfoFilterguardMethod(Tcl_Interp *interp, NsfObject *object, CONST char *filter) { - return object->opt ? GuardList(interp, object->opt->filters, filter) : TCL_OK; -} - -/* -objectInfoMethod filtermethods NsfObjInfoFiltermethodsMethod { - {-argName "-guards"} - {-argName "-order"} - {-argName "pattern"} -} -*/ -static int -NsfObjInfoFiltermethodsMethod(Tcl_Interp *interp, NsfObject *object, - int withGuards, int withOrder, - CONST char *pattern) { - NsfObjectOpt *opt = object->opt; - - if (withOrder) { - if (!(object->flags & NSF_FILTER_ORDER_VALID)) - FilterComputeDefined(interp, object); - return FilterInfo(interp, object->filterOrder, pattern, withGuards, 1); - } - return opt ? FilterInfo(interp, opt->filters, pattern, withGuards, 0) : TCL_OK; -} - -/* -objectInfoMethod forward NsfObjInfoForwardMethod { - {-argName "-definition"} - {-argName "name"} -} -*/ -static int -NsfObjInfoForwardMethod(Tcl_Interp *interp, NsfObject *object, int withDefinition, CONST char *pattern) { - return object->nsPtr ? - ListForward(interp, Tcl_Namespace_cmdTable(object->nsPtr), pattern, withDefinition) : - TCL_OK; -} - -/* -objectInfoMethod hasmixin NsfObjInfoHasMixinMethod { - {-argName "class" -type class} -} -*/ -static int -NsfObjInfoHasMixinMethod(Tcl_Interp *interp, NsfObject *object, NsfClass *mixinClass) { - Tcl_SetBooleanObj(Tcl_GetObjResult(interp), HasMixin(interp, object, mixinClass)); - return TCL_OK; -} - -/* -objectInfoMethod hasnamespace NsfObjInfoHasnamespaceMethod { -} -*/ -static int -NsfObjInfoHasnamespaceMethod(Tcl_Interp *interp, NsfObject *object) { - Tcl_SetBooleanObj(Tcl_GetObjResult(interp), object->nsPtr != NULL); - return TCL_OK; -} - -/* -objectInfoMethod hastype NsfObjInfoHasTypeMethod { - {-argName "class" -type class} -} -*/ -static int -NsfObjInfoHasTypeMethod(Tcl_Interp *interp, NsfObject *object, NsfClass *typeClass) { - Tcl_SetBooleanObj(Tcl_GetObjResult(interp), IsSubType(object->cl, typeClass)); - return TCL_OK; -} - -/* -objectInfoMethod is NsfObjInfoIsMethod { - {-argName "objectkind" -type "class|baseclass|metaclass"} -} -*/ -static int -NsfObjInfoIsMethod(Tcl_Interp *interp, NsfObject *object, int objectkind) { - int success = 0; - - switch (objectkind) { - case ObjectkindClassIdx: - success = (NsfObjectIsClass(object) > 0); - break; - - case ObjectkindMetaclassIdx: - success = NsfObjectIsClass(object) - && IsMetaClass(interp, (NsfClass*)object, 1); - break; - - case ObjectkindBaseclassIdx: - success = NsfObjectIsClass(object) - && IsBaseClass((NsfClass*)object); - break; - } - Tcl_SetIntObj(Tcl_GetObjResult(interp), success); - return TCL_OK; -} - -/* objectInfoMethod method NsfObjInfoMethodMethod { {-argName "infomethodsubcmd" -type "args|body|definition|handle|parameter|parametersyntax|type|precondition|postcondition"} {-argName "name"} Index: generic/tclAPI.h =================================================================== diff -u -r88ce4132aeb39289918426aa2c285c354a102a1e -r27e11788125901ff468955117d165f70d3871ce0 --- generic/tclAPI.h (.../tclAPI.h) (revision 88ce4132aeb39289918426aa2c285c354a102a1e) +++ generic/tclAPI.h (.../tclAPI.h) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -194,10 +194,6 @@ static int NsfOUpvarMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfOVolatileMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfOVwaitMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int NsfObjInfoCallableFilterMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int NsfObjInfoCallableMethodMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int NsfObjInfoCallableMethodsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int NsfObjInfoCallableSlotsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjInfoChildrenMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjInfoClassMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjInfoFilterguardMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -207,6 +203,10 @@ static int NsfObjInfoHasTypeMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjInfoHasnamespaceMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjInfoIsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfObjInfoLookupFilterMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfObjInfoLookupMethodMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfObjInfoLookupMethodsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int NsfObjInfoLookupSlotsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjInfoMethodMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjInfoMethodsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int NsfObjInfoMixinclassesMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -274,10 +274,6 @@ static int NsfOUpvarMethod(Tcl_Interp *interp, NsfObject *obj, int objc, Tcl_Obj *CONST objv[]); static int NsfOVolatileMethod(Tcl_Interp *interp, NsfObject *obj); static int NsfOVwaitMethod(Tcl_Interp *interp, NsfObject *obj, CONST char *varname); -static int NsfObjInfoCallableFilterMethod(Tcl_Interp *interp, NsfObject *obj, CONST char *filter); -static int NsfObjInfoCallableMethodMethod(Tcl_Interp *interp, NsfObject *obj, CONST char *name); -static int NsfObjInfoCallableMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withMethodtype, int withCallprotection, int withApplication, int withNomixins, int withIncontext, CONST char *pattern); -static int NsfObjInfoCallableSlotsMethod(Tcl_Interp *interp, NsfObject *obj, NsfClass *withType); static int NsfObjInfoChildrenMethod(Tcl_Interp *interp, NsfObject *obj, NsfClass *withType, CONST char *pattern); static int NsfObjInfoClassMethod(Tcl_Interp *interp, NsfObject *obj); static int NsfObjInfoFilterguardMethod(Tcl_Interp *interp, NsfObject *obj, CONST char *filter); @@ -287,6 +283,10 @@ static int NsfObjInfoHasTypeMethod(Tcl_Interp *interp, NsfObject *obj, NsfClass *class); static int NsfObjInfoHasnamespaceMethod(Tcl_Interp *interp, NsfObject *obj); 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, CONST char *name); +static int NsfObjInfoLookupMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withMethodtype, int withCallprotection, int withApplication, int withNomixins, int withIncontext, CONST char *pattern); +static int NsfObjInfoLookupSlotsMethod(Tcl_Interp *interp, NsfObject *obj, NsfClass *withType); static int NsfObjInfoMethodMethod(Tcl_Interp *interp, NsfObject *obj, int infomethodsubcmd, CONST char *name); static int NsfObjInfoMethodsMethod(Tcl_Interp *interp, NsfObject *obj, int withMethodtype, int withCallprotection, int withNomixins, int withIncontext, CONST char *pattern); static int NsfObjInfoMixinclassesMethod(Tcl_Interp *interp, NsfObject *obj, int withGuards, int withOrder, CONST char *patternString, NsfObject *patternObj); @@ -355,10 +355,6 @@ NsfOUpvarMethodIdx, NsfOVolatileMethodIdx, NsfOVwaitMethodIdx, - NsfObjInfoCallableFilterMethodIdx, - NsfObjInfoCallableMethodMethodIdx, - NsfObjInfoCallableMethodsMethodIdx, - NsfObjInfoCallableSlotsMethodIdx, NsfObjInfoChildrenMethodIdx, NsfObjInfoClassMethodIdx, NsfObjInfoFilterguardMethodIdx, @@ -368,6 +364,10 @@ NsfObjInfoHasTypeMethodIdx, NsfObjInfoHasnamespaceMethodIdx, NsfObjInfoIsMethodIdx, + NsfObjInfoLookupFilterMethodIdx, + NsfObjInfoLookupMethodMethodIdx, + NsfObjInfoLookupMethodsMethodIdx, + NsfObjInfoLookupSlotsMethodIdx, NsfObjInfoMethodMethodIdx, NsfObjInfoMethodsMethodIdx, NsfObjInfoMixinclassesMethodIdx, @@ -1544,257 +1544,257 @@ } static int -NsfObjInfoCallableFilterMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoChildrenMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoCallableFilterMethodIdx].paramDefs, - method_definitions[NsfObjInfoCallableFilterMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoChildrenMethodIdx].paramDefs, + method_definitions[NsfObjInfoChildrenMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - CONST char *filter = (CONST char *)pc.clientData[0]; + NsfClass *withType = (NsfClass *)pc.clientData[0]; + CONST char *pattern = (CONST char *)pc.clientData[1]; ParseContextRelease(&pc); - return NsfObjInfoCallableFilterMethod(interp, obj, filter); + return NsfObjInfoChildrenMethod(interp, obj, withType, pattern); } } static int -NsfObjInfoCallableMethodMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoClassMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoCallableMethodMethodIdx].paramDefs, - method_definitions[NsfObjInfoCallableMethodMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoClassMethodIdx].paramDefs, + method_definitions[NsfObjInfoClassMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - CONST char *name = (CONST char *)pc.clientData[0]; + ParseContextRelease(&pc); - return NsfObjInfoCallableMethodMethod(interp, obj, name); + return NsfObjInfoClassMethod(interp, obj); } } static int -NsfObjInfoCallableMethodsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoFilterguardMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoCallableMethodsMethodIdx].paramDefs, - method_definitions[NsfObjInfoCallableMethodsMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoFilterguardMethodIdx].paramDefs, + method_definitions[NsfObjInfoFilterguardMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - int withMethodtype = (int )PTR2INT(pc.clientData[0]); - int withCallprotection = (int )PTR2INT(pc.clientData[1]); - int withApplication = (int )PTR2INT(pc.clientData[2]); - int withNomixins = (int )PTR2INT(pc.clientData[3]); - int withIncontext = (int )PTR2INT(pc.clientData[4]); - CONST char *pattern = (CONST char *)pc.clientData[5]; + CONST char *filter = (CONST char *)pc.clientData[0]; ParseContextRelease(&pc); - return NsfObjInfoCallableMethodsMethod(interp, obj, withMethodtype, withCallprotection, withApplication, withNomixins, withIncontext, pattern); + return NsfObjInfoFilterguardMethod(interp, obj, filter); } } static int -NsfObjInfoCallableSlotsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoFiltermethodsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoCallableSlotsMethodIdx].paramDefs, - method_definitions[NsfObjInfoCallableSlotsMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoFiltermethodsMethodIdx].paramDefs, + method_definitions[NsfObjInfoFiltermethodsMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - NsfClass *withType = (NsfClass *)pc.clientData[0]; + int withGuards = (int )PTR2INT(pc.clientData[0]); + int withOrder = (int )PTR2INT(pc.clientData[1]); + CONST char *pattern = (CONST char *)pc.clientData[2]; ParseContextRelease(&pc); - return NsfObjInfoCallableSlotsMethod(interp, obj, withType); + return NsfObjInfoFiltermethodsMethod(interp, obj, withGuards, withOrder, pattern); } } static int -NsfObjInfoChildrenMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoForwardMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoChildrenMethodIdx].paramDefs, - method_definitions[NsfObjInfoChildrenMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoForwardMethodIdx].paramDefs, + method_definitions[NsfObjInfoForwardMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - NsfClass *withType = (NsfClass *)pc.clientData[0]; - CONST char *pattern = (CONST char *)pc.clientData[1]; + int withDefinition = (int )PTR2INT(pc.clientData[0]); + CONST char *name = (CONST char *)pc.clientData[1]; ParseContextRelease(&pc); - return NsfObjInfoChildrenMethod(interp, obj, withType, pattern); + return NsfObjInfoForwardMethod(interp, obj, withDefinition, name); } } static int -NsfObjInfoClassMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoHasMixinMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoClassMethodIdx].paramDefs, - method_definitions[NsfObjInfoClassMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoHasMixinMethodIdx].paramDefs, + method_definitions[NsfObjInfoHasMixinMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - + NsfClass *class = (NsfClass *)pc.clientData[0]; ParseContextRelease(&pc); - return NsfObjInfoClassMethod(interp, obj); + return NsfObjInfoHasMixinMethod(interp, obj, class); } } static int -NsfObjInfoFilterguardMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoHasTypeMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoFilterguardMethodIdx].paramDefs, - method_definitions[NsfObjInfoFilterguardMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoHasTypeMethodIdx].paramDefs, + method_definitions[NsfObjInfoHasTypeMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - CONST char *filter = (CONST char *)pc.clientData[0]; + NsfClass *class = (NsfClass *)pc.clientData[0]; ParseContextRelease(&pc); - return NsfObjInfoFilterguardMethod(interp, obj, filter); + return NsfObjInfoHasTypeMethod(interp, obj, class); } } static int -NsfObjInfoFiltermethodsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoHasnamespaceMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoFiltermethodsMethodIdx].paramDefs, - method_definitions[NsfObjInfoFiltermethodsMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoHasnamespaceMethodIdx].paramDefs, + method_definitions[NsfObjInfoHasnamespaceMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - int withGuards = (int )PTR2INT(pc.clientData[0]); - int withOrder = (int )PTR2INT(pc.clientData[1]); - CONST char *pattern = (CONST char *)pc.clientData[2]; + ParseContextRelease(&pc); - return NsfObjInfoFiltermethodsMethod(interp, obj, withGuards, withOrder, pattern); + return NsfObjInfoHasnamespaceMethod(interp, obj); } } static int -NsfObjInfoForwardMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoIsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoForwardMethodIdx].paramDefs, - method_definitions[NsfObjInfoForwardMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoIsMethodIdx].paramDefs, + method_definitions[NsfObjInfoIsMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - int withDefinition = (int )PTR2INT(pc.clientData[0]); - CONST char *name = (CONST char *)pc.clientData[1]; + int objectkind = (int )PTR2INT(pc.clientData[0]); ParseContextRelease(&pc); - return NsfObjInfoForwardMethod(interp, obj, withDefinition, name); + return NsfObjInfoIsMethod(interp, obj, objectkind); } } static int -NsfObjInfoHasMixinMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoLookupFilterMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoHasMixinMethodIdx].paramDefs, - method_definitions[NsfObjInfoHasMixinMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoLookupFilterMethodIdx].paramDefs, + method_definitions[NsfObjInfoLookupFilterMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - NsfClass *class = (NsfClass *)pc.clientData[0]; + CONST char *filter = (CONST char *)pc.clientData[0]; ParseContextRelease(&pc); - return NsfObjInfoHasMixinMethod(interp, obj, class); + return NsfObjInfoLookupFilterMethod(interp, obj, filter); } } static int -NsfObjInfoHasTypeMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoLookupMethodMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoHasTypeMethodIdx].paramDefs, - method_definitions[NsfObjInfoHasTypeMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoLookupMethodMethodIdx].paramDefs, + method_definitions[NsfObjInfoLookupMethodMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - NsfClass *class = (NsfClass *)pc.clientData[0]; + CONST char *name = (CONST char *)pc.clientData[0]; ParseContextRelease(&pc); - return NsfObjInfoHasTypeMethod(interp, obj, class); + return NsfObjInfoLookupMethodMethod(interp, obj, name); } } static int -NsfObjInfoHasnamespaceMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoLookupMethodsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoHasnamespaceMethodIdx].paramDefs, - method_definitions[NsfObjInfoHasnamespaceMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoLookupMethodsMethodIdx].paramDefs, + method_definitions[NsfObjInfoLookupMethodsMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - + int withMethodtype = (int )PTR2INT(pc.clientData[0]); + int withCallprotection = (int )PTR2INT(pc.clientData[1]); + int withApplication = (int )PTR2INT(pc.clientData[2]); + int withNomixins = (int )PTR2INT(pc.clientData[3]); + int withIncontext = (int )PTR2INT(pc.clientData[4]); + CONST char *pattern = (CONST char *)pc.clientData[5]; ParseContextRelease(&pc); - return NsfObjInfoHasnamespaceMethod(interp, obj); + return NsfObjInfoLookupMethodsMethod(interp, obj, withMethodtype, withCallprotection, withApplication, withNomixins, withIncontext, pattern); } } static int -NsfObjInfoIsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { +NsfObjInfoLookupSlotsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { ParseContext pc; NsfObject *obj = (NsfObject *)clientData; if (!obj) return NsfObjErrType(interp, objv[0], "Object", ""); if (ArgumentParse(interp, objc, objv, obj, objv[0], - method_definitions[NsfObjInfoIsMethodIdx].paramDefs, - method_definitions[NsfObjInfoIsMethodIdx].nrParameters, 1, + method_definitions[NsfObjInfoLookupSlotsMethodIdx].paramDefs, + method_definitions[NsfObjInfoLookupSlotsMethodIdx].nrParameters, 1, &pc) != TCL_OK) { return TCL_ERROR; } else { - int objectkind = (int )PTR2INT(pc.clientData[0]); + NsfClass *withType = (NsfClass *)pc.clientData[0]; ParseContextRelease(&pc); - return NsfObjInfoIsMethod(interp, obj, objectkind); + return NsfObjInfoLookupSlotsMethod(interp, obj, withType); } } @@ -2207,23 +2207,6 @@ {"::nsf::cmd::Object::vwait", NsfOVwaitMethodStub, 1, { {"varname", 1, 0, ConvertToString}} }, -{"::nsf::cmd::ObjectInfo::callablefilter", NsfObjInfoCallableFilterMethodStub, 1, { - {"filter", 0, 0, ConvertToString}} -}, -{"::nsf::cmd::ObjectInfo::callablemethod", NsfObjInfoCallableMethodMethodStub, 1, { - {"name", 0, 0, ConvertToString}} -}, -{"::nsf::cmd::ObjectInfo::callablemethods", NsfObjInfoCallableMethodsMethodStub, 6, { - {"-methodtype", 0, 1, ConvertToMethodtype}, - {"-callprotection", 0, 1, ConvertToCallprotection}, - {"-application", 0, 0, ConvertToString}, - {"-nomixins", 0, 0, ConvertToString}, - {"-incontext", 0, 0, ConvertToString}, - {"pattern", 0, 0, ConvertToString}} -}, -{"::nsf::cmd::ObjectInfo::callableslots", NsfObjInfoCallableSlotsMethodStub, 1, { - {"-type", 0, 1, ConvertToClass}} -}, {"::nsf::cmd::ObjectInfo::children", NsfObjInfoChildrenMethodStub, 2, { {"-type", 0, 1, ConvertToClass}, {"pattern", 0, 0, ConvertToString}} @@ -2255,6 +2238,23 @@ {"::nsf::cmd::ObjectInfo::is", NsfObjInfoIsMethodStub, 1, { {"objectkind", 0, 0, ConvertToObjectkind}} }, +{"::nsf::cmd::ObjectInfo::lookupfilter", NsfObjInfoLookupFilterMethodStub, 1, { + {"filter", 0, 0, ConvertToString}} +}, +{"::nsf::cmd::ObjectInfo::lookupmethod", NsfObjInfoLookupMethodMethodStub, 1, { + {"name", 0, 0, ConvertToString}} +}, +{"::nsf::cmd::ObjectInfo::lookupmethods", NsfObjInfoLookupMethodsMethodStub, 6, { + {"-methodtype", 0, 1, ConvertToMethodtype}, + {"-callprotection", 0, 1, ConvertToCallprotection}, + {"-application", 0, 0, ConvertToString}, + {"-nomixins", 0, 0, ConvertToString}, + {"-incontext", 0, 0, ConvertToString}, + {"pattern", 0, 0, ConvertToString}} +}, +{"::nsf::cmd::ObjectInfo::lookupslots", NsfObjInfoLookupSlotsMethodStub, 1, { + {"-type", 0, 1, ConvertToClass}} +}, {"::nsf::cmd::ObjectInfo::method", NsfObjInfoMethodMethodStub, 2, { {"infomethodsubcmd", 0, 0, ConvertToInfomethodsubcmd}, {"name", 0, 0, ConvertToString}} Index: library/lib/doc-tools.tcl =================================================================== diff -u -r25f4f3c883ff0021b8564377f6658afb69c346c8 -r27e11788125901ff468955117d165f70d3871ce0 --- library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 25f4f3c883ff0021b8564377f6658afb69c346c8) +++ library/lib/doc-tools.tcl (.../doc-tools.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -508,7 +508,7 @@ :method register {containable:object,type=::nx::doc::Entity} { set tag [[$containable info class] tag] - if {[:info callable methods -application "@$tag"] ne ""} { + if {[:info lookup methods -application "@$tag"] ne ""} { :@$tag $containable } } @@ -1971,7 +1971,7 @@ :method parse@tag {line} { set line [split [string trimleft $line]] set tag [lindex $line 0] - if {[:info callable methods -application $tag] eq ""} { + if {[:info lookup methods -application $tag] eq ""} { set msg "The tag '$tag' is not supported for the entity type '[namespace tail [:info class]]" ${:block_parser} cancel INVALIDTAG $msg } @@ -2042,7 +2042,7 @@ set args [lassign $line tag name] lassign [:resolve_partof_entity $tag $name] nq_name partof_entity if {$partof_entity ne ""} { - if {[$partof_entity info callable methods -application $tag] eq ""} { + if {[$partof_entity info lookup methods -application $tag] eq ""} { ${:block_parser} cancel INVALIDTAG "The tag '$tag' is not supported for the entity type '[namespace tail [$partof_entity info class]]'" # [InvalidTag new -message [subst { @@ -2132,7 +2132,7 @@ # set operand [@$axis new -name $value ] set operand [@$axis id $value] } else { - if {[$operand info callable methods -application @$axis] eq ""} { + if {[$operand info lookup methods -application @$axis] eq ""} { ${:block_parser} cancel INVALIDTAG "The tag '$axis' is not supported for the entity type '[namespace tail [$operand info class]]'" } # puts stderr "$operand @$axis id $value" @@ -2149,7 +2149,7 @@ } set operand [@$leaf(axis) new -name $leaf(name) $args] } else { - if {[$operand info callable methods -application @$leaf(axis)] eq ""} { + if {[$operand info lookup methods -application @$leaf(axis)] eq ""} { ${:block_parser} cancel INVALIDTAG "The tag '$leaf(axis)' is not supported for the entity type '[namespace tail [$operand info class]]'" } set operand [$operand @$leaf(axis) [list $leaf(name) {*}$args]] Index: library/nx/nx.tcl =================================================================== diff -u -r1e20304eae1c4ca141334902bfef6a1789ad0c41 -r27e11788125901ff468955117d165f70d3871ce0 --- library/nx/nx.tcl (.../nx.tcl) (revision 1e20304eae1c4ca141334902bfef6a1789ad0c41) +++ library/nx/nx.tcl (.../nx.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -448,13 +448,13 @@ # we have to use "eval", since objectParameters are not defined yet Object eval { - #:alias "info callable" ::nsf::cmd::ObjectInfo::callable - :alias "info callable filter" ::nsf::cmd::ObjectInfo::callablefilter - :alias "info callable method" ::nsf::cmd::ObjectInfo::callablemethod - :alias "info callable methods" ::nsf::cmd::ObjectInfo::callablemethods - :method "info callable slots" {} { + #:alias "info lookup" ::nsf::cmd::ObjectInfo::lookup + :alias "info lookup filter" ::nsf::cmd::ObjectInfo::lookupfilter + :alias "info lookup method" ::nsf::cmd::ObjectInfo::lookupmethod + :alias "info lookup methods" ::nsf::cmd::ObjectInfo::lookupmethods + :method "info lookup slots" {} { ::nsf::dispatch [::nsf::current object] \ - ::nsf::cmd::ObjectInfo::callableslots -type ::nx::Slot + ::nsf::cmd::ObjectInfo::lookupslots -type ::nx::Slot } :alias "info children" ::nsf::cmd::ObjectInfo::children :alias "info class" ::nsf::cmd::ObjectInfo::class @@ -498,21 +498,10 @@ } Class eval { - #:alias "info callable filter" ::nsf::cmd::ObjectInfo::callablefilter - #:alias "info callable method" ::nsf::cmd::ObjectInfo::callablemethod - #:alias "info callable methods" ::nsf::cmd::ObjectInfo::callablemethods - #:method "info callable slots" {} { - # ::nsf::dispatch [::nsf::current object] \ -# ::nsf::cmd::ObjectInfo::callableslots -type ::nx::Slot - #} - :alias "info callable" ::nx::Object::slot::__info::callable + :alias "info lookup" ::nx::Object::slot::__info::lookup :alias "info filter guard" ::nsf::cmd::ClassInfo::filterguard :alias "info filter methods" ::nsf::cmd::ClassInfo::filtermethods :alias "info forward" ::nsf::cmd::ClassInfo::forward - # todo: maybe share "has"? - #:alias "info has mixin" ::nsf::cmd::ObjectInfo::hasmixin - #:alias "info has namespace" ::nsf::cmd::ObjectInfo::hasnamespace - #:alias "info has type" ::nsf::cmd::ObjectInfo::hastype :alias "info has" ::nx::Object::slot::__info::has :alias "info heritage" ::nsf::cmd::ClassInfo::heritage :alias "info instances" ::nsf::cmd::ClassInfo::instances @@ -556,8 +545,8 @@ # puts Object::info-methods=[lsort [nsf::dispatch ::nx::Object::slot::__info ::nsf::cmd::ObjectInfo::methods]] # puts Class::info-methods_=[lsort [nsf::dispatch ::nx::Class::slot::__info ::nsf::cmd::ObjectInfo::methods]] # puts "" - # puts Object::info-callable=[nsf::dispatch ::nx::Object ::nsf::cmd::ObjectInfo::callablemethod info] - # puts Class::info-callable_=[nsf::dispatch ::nx::Class ::nsf::cmd::ObjectInfo::callablemethod info] + # puts Object::info-lookup=[nsf::dispatch ::nx::Object ::nsf::cmd::ObjectInfo::lookupmethod info] + # puts Class::info-lookup_=[nsf::dispatch ::nx::Class ::nsf::cmd::ObjectInfo::lookupmethod info] # puts "" # puts Object::info-def=[nsf::dispatch ::nx::Object ::nsf::cmd::ClassInfo::method definition info] # puts Class::info-def_=[nsf::dispatch ::nx::Class ::nsf::cmd::ClassInfo::method definition info] @@ -756,8 +745,8 @@ ObjectParameterSlot method unknown {method args} { set methods [list] - foreach m [::nsf::dispatch [::nsf::current object] ::nsf::cmd::ObjectInfo::callablemethods] { - if {[::nsf::dispatch Object ::nsf::cmd::ObjectInfo::callablemethods $m] ne ""} continue + foreach m [::nsf::dispatch [::nsf::current object] ::nsf::cmd::ObjectInfo::lookupmethods] { + if {[::nsf::dispatch Object ::nsf::cmd::ObjectInfo::lookupmethods $m] ne ""} continue if {[string match __* $m]} continue lappend methods $m } @@ -890,7 +879,7 @@ proc ::nsf::parametersFromSlots {obj} { set parameterdefinitions [list] - foreach slot [::nsf::dispatch $obj ::nsf::cmd::ObjectInfo::callableslots -type ::nx::Slot] { + foreach slot [::nsf::dispatch $obj ::nsf::cmd::ObjectInfo::lookupslots -type ::nx::Slot] { # Skip some slots for xotcl; # TODO: maybe different parameterFromSlots for xotcl? if {[::nsf::is class ::xotcl::Object] @@ -1173,13 +1162,13 @@ # defaults. If this is not the case, we cannot replace them with # the plain setters. # - set assignInfo [:info method definition [:info callable method assign]] + set assignInfo [:info method definition [:info lookup method assign]] #puts stderr "OPTIMIZER assign=$assignInfo//[lindex $assignInfo end]//[:info precedence]" if {$assignInfo ne "::nx::ObjectParameterSlot alias assign ::nsf::setvar" && [lindex $assignInfo end] ne {::nsf::setvar $obj $var $value} } return #if {$assignInfo ne "::nx::ObjectParameterSlot alias assign ::nsf::setvar"} return - set getInfo [:info method definition [:info callable method get]] + set getInfo [:info method definition [:info lookup method get]] if {$getInfo ne "::nx::ObjectParameterSlot alias get ::nsf::setvar"} return array set "" [:toParameterSyntax ${:name}] Index: library/xotcl/doc/tutorial.html =================================================================== diff -u -re8715774bf274fbeadabf08a5a0777a968f71148 -r27e11788125901ff468955117d165f70d3871ce0 --- library/xotcl/doc/tutorial.html (.../tutorial.html) (revision e8715774bf274fbeadabf08a5a0777a968f71148) +++ library/xotcl/doc/tutorial.html (.../tutorial.html) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -590,7 +590,7 @@

   SoccerTeam chelsea -name "Chelsea FC" -location "Chelsea"
-  SoccerTeam bayernMunich -name "F.C. Bayern M�nchen" -location "Munich"
+  SoccerTeam bayernMunich -name "F.C. Bayern München" -location "Munich"
 

@@ -1857,7 +1857,7 @@ Class NoClassInfo -superclass Class # redefine info ability NoClassInfo instproc info args { - error "No class info available" + error "No class info lookup" } # derive agent class from meta-class, which # can not access class info Index: library/xotcl/library/xotcl2.tcl =================================================================== diff -u -r88ce4132aeb39289918426aa2c285c354a102a1e -r27e11788125901ff468955117d165f70d3871ce0 --- library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 88ce4132aeb39289918426aa2c285c354a102a1e) +++ library/xotcl/library/xotcl2.tcl (.../xotcl2.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -482,7 +482,7 @@ set methodtype all if {$nocmds} {set methodtype scripted} if {$noprocs} {if {$nocmds} {return ""}; set methodtype builtin} - set cmd [list ::nsf::cmd::ObjectInfo::callablemethods -methodtype $methodtype] + set cmd [list ::nsf::cmd::ObjectInfo::lookupmethods -methodtype $methodtype] if {$incontext} {lappend cmd -incontext} if {[info exists pattern]} {lappend cmd $pattern} my {*}$cmd @@ -694,12 +694,12 @@ } Object instproc filtersearch {filter} { set handle [::nsf::dispatch [::nsf::current object] \ - ::nsf::cmd::ObjectInfo::callablefilter $filter] + ::nsf::cmd::ObjectInfo::lookupfilter $filter] return [method_handle_to_xotcl $handle] } Object instproc procsearch {name} { set handle [::nsf::dispatch [::nsf::current object] \ - ::nsf::cmd::ObjectInfo::callablemethod $name] + ::nsf::cmd::ObjectInfo::lookupmethod $name] return [method_handle_to_xotcl $handle] } Class instproc allinstances {} { Index: library/xotcl/tests/slottest.xotcl =================================================================== diff -u -rb6d81c6521d1e1d58f00763f5ab30a0946cc222a -r27e11788125901ff468955117d165f70d3871ce0 --- library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision b6d81c6521d1e1d58f00763f5ab30a0946cc222a) +++ library/xotcl/tests/slottest.xotcl (.../slottest.xotcl) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -322,8 +322,8 @@ ? {a0 procsearch f3} "::a0 proc f3" ? {a0 procsearch f4} "::a0 forward f4" ? {a0 procsearch set} "::xotcl::Object instcmd set" -#? {A slot foo info callable method assign} "::nsf::classes::nx::ObjectParameterSlot::assign" -? {A::slot::foo info callable method assign} "::nsf::classes::nx::ObjectParameterSlot::assign" +#? {A slot foo info lookup method assign} "::nsf::classes::nx::ObjectParameterSlot::assign" +? {A::slot::foo info lookup method assign} "::nsf::classes::nx::ObjectParameterSlot::assign" # redefine setter for foo of class A #A slot foo method assign {domain var val} ... Index: tests/aliastest.tcl =================================================================== diff -u -re548a952433b4d26794f535995c9ed1ababe8807 -r27e11788125901ff468955117d165f70d3871ce0 --- tests/aliastest.tcl (.../aliastest.tcl) (revision e548a952433b4d26794f535995c9ed1ababe8807) +++ tests/aliastest.tcl (.../aliastest.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -230,8 +230,8 @@ namespace delete ::U ? {namespace exists ::U} 0 ? {lsort [U object info methods]} {} - ? {U info callable methods BAR} "" - ? {U info callable methods ZAP} "" + ? {U info lookup methods BAR} "" + ? {U info lookup methods ZAP} "" ::U destroy } Index: tests/info-method.tcl =================================================================== diff -u -r88ce4132aeb39289918426aa2c285c354a102a1e -r27e11788125901ff468955117d165f70d3871ce0 --- tests/info-method.tcl (.../info-method.tcl) (revision 88ce4132aeb39289918426aa2c285c354a102a1e) +++ tests/info-method.tcl (.../info-method.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -26,16 +26,16 @@ ? {lsort [C info methods -callprotection all]} "a addOne m m-with-assertions s" #? {lsort [C info methods]} "a addOne s" foreach m [lsort [C info methods -callprotection all]] { - ? [subst -nocommands {lsort [c1 info callable methods $m]}] $m + ? [subst -nocommands {lsort [c1 info lookup methods $m]}] $m } ? {C info method definition a} "::C alias a ::set" - ? {c1 info callable method a} "::nsf::classes::C::a" - ? {c1 info callable method addOne} "::nsf::classes::C::addOne" - ? {c1 info callable method m} "::nsf::classes::C::m" - ? {c1 info callable method s} "::nsf::classes::C::s" + ? {c1 info lookup method a} "::nsf::classes::C::a" + ? {c1 info lookup method addOne} "::nsf::classes::C::addOne" + ? {c1 info lookup method m} "::nsf::classes::C::m" + ? {c1 info lookup method s} "::nsf::classes::C::s" c1 method foo {} {puts foo} ? {c1 info method definition foo} "::c1 method foo {} {puts foo}" - ? {c1 info callable method foo} "::c1::foo" + ? {c1 info lookup method foo} "::c1::foo" ? {C info method handle m} "::nsf::classes::C::m" ? {C object info method handle mpo} "::C::mpo" @@ -63,10 +63,10 @@ ? {C info method definition a} "::C alias a ::set" ? {C object info method definition apo} "::C object alias apo ::puts" - ? {::nx::Object info callable methods -application} "" - ? {::nx::Class info callable methods -application} "" - ? {lsort [C info callable methods -application]} "add1 apo fpo mpo spo" - ? {lsort [c1 info callable methods -application]} "a addOne foo m m-with-assertions s" + ? {::nx::Object info lookup methods -application} "" + ? {::nx::Class info lookup methods -application} "" + ? {lsort [C info lookup methods -application]} "add1 apo fpo mpo spo" + ? {lsort [c1 info lookup methods -application]} "a addOne foo m m-with-assertions s" } Test case subobj { @@ -88,15 +88,15 @@ ::nx::Class method bar {} {return Class.bar} ::nx::Object create o - ? {o info callable method bar} "::nsf::classes::nx::Object::bar" - ? {o info callable methods bar} bar + ? {o info lookup method bar} "::nsf::classes::nx::Object::bar" + ? {o info lookup methods bar} bar ? {o bar} Object.bar o mixin ::nx::Class - ? {o info callable method bar} "::nsf::classes::nx::Class::bar" - ? {o info callable methods bar} bar - ? {o info callable methods superclass} "" - ? {o info callable method superclass} "" + ? {o info lookup method bar} "::nsf::classes::nx::Class::bar" + ? {o info lookup methods bar} bar + ? {o info lookup methods superclass} "" + ? {o info lookup method superclass} "" ? {o bar} Class.bar ? {o method foo {} {return o.foo}} "::o::foo" @@ -109,9 +109,9 @@ ? {lsort [o info methods]} "A foo fwd is x" o method f args ::nx::next - ? {o info callable methods superclass} "" - ? {o info callable methods filter} "filter" - ? {o info callable method filter} "::nsf::classes::nx::Object::filter" + ? {o info lookup methods superclass} "" + ? {o info lookup methods filter} "filter" + ? {o info lookup method filter} "::nsf::classes::nx::Object::filter" ? {o filter f} "" ? {o filter guard f { 1 == 1 }} "" ? {o info filter guard f} " 1 == 1 " @@ -170,8 +170,8 @@ Foo object mixin delete ::Fly ? {Foo object info mixin classes} "::nx::Class" - ? {Foo info callable methods superclass} "superclass" - ? {Foo info callable method superclass} "::nsf::classes::nx::Class::superclass" + ? {Foo info lookup methods superclass} "superclass" + ? {Foo info lookup method superclass} "::nsf::classes::nx::Class::superclass" ? {o mixin ""} "" } @@ -191,7 +191,7 @@ } D create d1 - ? {D info callable slots} "::nx::Class::slot::object-mixin ::nx::Class::slot::mixin ::nx::Class::slot::superclass ::nx::Class::slot::object-filter ::nx::Class::slot::filter ::nx::Object::slot::class" + ? {D info lookup slots} "::nx::Class::slot::object-mixin ::nx::Class::slot::mixin ::nx::Class::slot::superclass ::nx::Class::slot::object-filter ::nx::Class::slot::filter ::nx::Object::slot::class" ? {D info slots} "::D::slot::b ::D::slot::a2 ::D::slot::c" ? {::nx::Object info method parameter info} "" } \ No newline at end of file Index: tests/interceptor-slot.tcl =================================================================== diff -u -r475bb7279b7df4c5bbdb90986ec3dfd988cf8776 -r27e11788125901ff468955117d165f70d3871ce0 --- tests/interceptor-slot.tcl (.../interceptor-slot.tcl) (revision 475bb7279b7df4c5bbdb90986ec3dfd988cf8776) +++ tests/interceptor-slot.tcl (.../interceptor-slot.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -9,7 +9,7 @@ Class create M2 Class create C -? {C info callable method mixin} "::nsf::classes::nx::Class::mixin" +? {C info lookup method mixin} "::nsf::classes::nx::Class::mixin" C mixin M ? {C info precedence} "::nx::Class ::nx::Object" ? {C mixin} "::M" @@ -107,7 +107,7 @@ Class create M11 Class create C1 - ? {C1 info callable method mixin} "::nsf::classes::nx::Class::mixin" + ? {C1 info lookup method mixin} "::nsf::classes::nx::Class::mixin" C1 object mixin M1 ? {C1 info precedence} "::M1 ::nx::Class ::nx::Object" C1 create c11 @@ -135,7 +135,7 @@ #puts stderr "$i: procsearch before [$s procsearch info]" set r [next] #puts stderr "$i: $s.$m got ($r)" - #puts stderr "$i: $s.$m procsearch after [$s info callable method info]" + #puts stderr "$i: $s.$m procsearch after [$s info lookup method info]" return $r } # method for testing next to non-existing shadowed method Index: tests/mixinoftest.tcl =================================================================== diff -u -re849d060161385466c782e46c19344428934cd7f -r27e11788125901ff468955117d165f70d3871ce0 --- tests/mixinoftest.tcl (.../mixinoftest.tcl) (revision e849d060161385466c782e46c19344428934cd7f) +++ tests/mixinoftest.tcl (.../mixinoftest.tcl) (revision 27e11788125901ff468955117d165f70d3871ce0) @@ -51,17 +51,17 @@ ? {o info mixin classes} ::M ? {o info precedence} "::M ::nx::Object" -? {o info callable method foo} "::nsf::classes::M::foo" +? {o info lookup method foo} "::nsf::classes::M::foo" Class create M {:method foo args next} ? {o info mixin classes} ::M ? {o info precedence} "::M ::nx::Object" -? {o info callable method foo} "::nsf::classes::M::foo" +? {o info lookup method foo} "::nsf::classes::M::foo" M destroy ? {o info mixin classes} "" ? {o info precedence} "::nx::Object" -? {o info callable method foo} "" +? {o info lookup method foo} "" o destroy