Index: generic/gentclAPI.decls =================================================================== diff -u -rf6be3f63eadda89d7f419a090d86669c6be84c3b -rdb7c710aa3b6386c33af9a318876f21a88b8aafd --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision f6be3f63eadda89d7f419a090d86669c6be84c3b) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision db7c710aa3b6386c33af9a318876f21a88b8aafd) @@ -258,6 +258,11 @@ # # info object methods # +infoObjectMethod alias XOTclObjInfoAliasMethod { + {-argName "object" -required 1 -type object} + {-argName "-definition"} + {-argName "name"} +} infoObjectMethod body XOTclObjInfoBodyMethod { {-argName "object" -required 1 -type object} {-argName "methodName" -required 1} @@ -289,7 +294,7 @@ infoObjectMethod forward XOTclObjInfoForwardMethod { {-argName "object" -required 1 -type object} {-argName "-definition"} - {-argName "pattern"} + {-argName "name"} } infoObjectMethod hasnamespace XOTclObjInfoHasnamespaceMethod { {-argName "object" -required 1 -type object} @@ -354,6 +359,12 @@ # # info class methods # +infoClassMethod alias XOTclClassInfoAliasMethod { + {-argName "object" -required 1 -type class} + {-argName "-definition"} + {-argName "-per-object"} + {-argName "name"} +} infoClassMethod heritage XOTclClassInfoHeritageMethod { {-argName "class" -required 1 -type class} {-argName "pattern"} @@ -383,7 +394,7 @@ infoClassMethod instforward XOTclClassInfoInstforwardMethod { {-argName "class" -required 1 -type class} {-argName "-definition"} - {-argName "pattern"} + {-argName "name"} } infoClassMethod instinvar XOTclClassInfoInstinvarMethod { {-argName "class" -required 1 -type class} Index: generic/predefined.h =================================================================== diff -u -r9f7fa883bf6ed48f1401f815caca1e34f56584a1 -rdb7c710aa3b6386c33af9a318876f21a88b8aafd --- generic/predefined.h (.../predefined.h) (revision 9f7fa883bf6ed48f1401f815caca1e34f56584a1) +++ generic/predefined.h (.../predefined.h) (revision db7c710aa3b6386c33af9a318876f21a88b8aafd) @@ -36,12 +36,6 @@ "eval ::xotcl::alias [self] $methodName $cmd}}\n" "Object create ::xotcl2::objectInfo\n" "Object create ::xotcl2::classInfo\n" -"foreach cmd [info command ::xotcl::cmd::ObjectInfo::*] {\n" -"::xotcl::alias ::xotcl2::objectInfo [namespace tail $cmd] $cmd\n" -"::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd}\n" -"foreach cmd [info command ::xotcl::cmd::ClassInfo::*] {\n" -"::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd}\n" -"unset cmd\n" "::xotcl::dispatch objectInfo -objscope ::eval {\n" ".alias is -cmd ::xotcl::is\n" ".method info {obj} {\n" @@ -58,6 +52,12 @@ ".alias classchildren -cmd ::xotcl::cmd::ObjectInfo::children\n" ".alias info -source-object objectInfo -source-per-object -source-method info\n" ".alias unknown -source-object objectInfo -source-per-object -source-method unknown}\n" +"foreach cmd [info command ::xotcl::cmd::ObjectInfo::*] {\n" +"::xotcl::alias ::xotcl2::objectInfo [namespace tail $cmd] $cmd\n" +"::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd}\n" +"foreach cmd [info command ::xotcl::cmd::ClassInfo::*] {\n" +"::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd}\n" +"unset cmd\n" "Object instforward info -onerror ::xotcl::infoError ::xotcl2::objectInfo %1 {%@2 %self}\n" "Class instforward info -onerror ::xotcl::infoError ::xotcl2::classInfo %1 {%@2 %self}\n" "proc ::xotcl::infoError msg {\n" Index: generic/predefined.xotcl =================================================================== diff -u -r9f7fa883bf6ed48f1401f815caca1e34f56584a1 -rdb7c710aa3b6386c33af9a318876f21a88b8aafd --- generic/predefined.xotcl (.../predefined.xotcl) (revision 9f7fa883bf6ed48f1401f815caca1e34f56584a1) +++ generic/predefined.xotcl (.../predefined.xotcl) (revision db7c710aa3b6386c33af9a318876f21a88b8aafd) @@ -94,15 +94,6 @@ Object create ::xotcl2::objectInfo Object create ::xotcl2::classInfo - foreach cmd [info command ::xotcl::cmd::ObjectInfo::*] { - ::xotcl::alias ::xotcl2::objectInfo [namespace tail $cmd] $cmd - ::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd - } - foreach cmd [info command ::xotcl::cmd::ClassInfo::*] { - ::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd - } - unset cmd - # # It would be nice to do here "objectInfo configure {.alias ..}", but # we have no working objectparameter yet due to bootstrapping @@ -132,6 +123,15 @@ .alias unknown -source-object objectInfo -source-per-object -source-method unknown } + foreach cmd [info command ::xotcl::cmd::ObjectInfo::*] { + ::xotcl::alias ::xotcl2::objectInfo [namespace tail $cmd] $cmd + ::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd + } + foreach cmd [info command ::xotcl::cmd::ClassInfo::*] { + ::xotcl::alias ::xotcl2::classInfo [namespace tail $cmd] $cmd + } + unset cmd + Object instforward info -onerror ::xotcl::infoError ::xotcl2::objectInfo %1 {%@2 %self} Class instforward info -onerror ::xotcl::infoError ::xotcl2::classInfo %1 {%@2 %self} Index: generic/tclAPI.h =================================================================== diff -u -rf6be3f63eadda89d7f419a090d86669c6be84c3b -rdb7c710aa3b6386c33af9a318876f21a88b8aafd --- generic/tclAPI.h (.../tclAPI.h) (revision f6be3f63eadda89d7f419a090d86669c6be84c3b) +++ generic/tclAPI.h (.../tclAPI.h) (revision db7c710aa3b6386c33af9a318876f21a88b8aafd) @@ -92,6 +92,7 @@ static int XOTclCMethodMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclCNewMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclCRecreateMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int XOTclClassInfoAliasMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoHeritageMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoInstancesMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoInstbodyMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -112,6 +113,7 @@ static int XOTclClassInfoSlotsMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoSubclassMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclClassInfoSuperclassMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); +static int XOTclObjInfoAliasMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclObjInfoBodyMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclObjInfoCheckMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclObjInfoChildrenMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -189,13 +191,14 @@ static int XOTclCMethodMethod(Tcl_Interp *interp, XOTclClass *cl, int withInner_namespace, int withPer_object, int withProtected, Tcl_Obj *name, Tcl_Obj *args, Tcl_Obj *body, Tcl_Obj *withPrecondition, Tcl_Obj *withPostcondition); static int XOTclCNewMethod(Tcl_Interp *interp, XOTclClass *cl, XOTclObject *withChildof, int nobjc, Tcl_Obj *CONST nobjv[]); static int XOTclCRecreateMethod(Tcl_Interp *interp, XOTclClass *cl, Tcl_Obj *name, int objc, Tcl_Obj *CONST objv[]); +static int XOTclClassInfoAliasMethod(Tcl_Interp *interp, XOTclClass *object, int withDefinition, int withPer_object, char *name); static int XOTclClassInfoHeritageMethod(Tcl_Interp *interp, XOTclClass *class, char *pattern); static int XOTclClassInfoInstancesMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, char *patternString, XOTclObject *patternObj); static int XOTclClassInfoInstbodyMethod(Tcl_Interp *interp, XOTclClass *class, char *methodName); static int XOTclClassInfoInstcommandsMethod(Tcl_Interp *interp, XOTclClass *class, char *pattern); static int XOTclClassInfoInstfilterMethod(Tcl_Interp *interp, XOTclClass *class, int withGuards, char *pattern); static int XOTclClassInfoInstfilterguardMethod(Tcl_Interp *interp, XOTclClass *class, char *filter); -static int XOTclClassInfoInstforwardMethod(Tcl_Interp *interp, XOTclClass *class, int withDefinition, char *pattern); +static int XOTclClassInfoInstforwardMethod(Tcl_Interp *interp, XOTclClass *class, int withDefinition, char *name); static int XOTclClassInfoInstinvarMethod(Tcl_Interp *interp, XOTclClass *class); static int XOTclClassInfoInstmixinMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, int withGuards, char *patternString, XOTclObject *patternObj); static int XOTclClassInfoInstmixinguardMethod(Tcl_Interp *interp, XOTclClass *class, char *mixin); @@ -209,14 +212,15 @@ static int XOTclClassInfoSlotsMethod(Tcl_Interp *interp, XOTclClass *class); static int XOTclClassInfoSubclassMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, char *patternString, XOTclObject *patternObj); static int XOTclClassInfoSuperclassMethod(Tcl_Interp *interp, XOTclClass *class, int withClosure, Tcl_Obj *pattern); +static int XOTclObjInfoAliasMethod(Tcl_Interp *interp, XOTclObject *object, int withDefinition, char *name); static int XOTclObjInfoBodyMethod(Tcl_Interp *interp, XOTclObject *object, char *methodName); static int XOTclObjInfoCheckMethod(Tcl_Interp *interp, XOTclObject *object); static int XOTclObjInfoChildrenMethod(Tcl_Interp *interp, XOTclObject *object, char *pattern); static int XOTclObjInfoClassMethod(Tcl_Interp *interp, XOTclObject *object); static int XOTclObjInfoCommandsMethod(Tcl_Interp *interp, XOTclObject *object, char *pattern); static int XOTclObjInfoFilterMethod(Tcl_Interp *interp, XOTclObject *object, int withOrder, int withGuards, char *pattern); static int XOTclObjInfoFilterguardMethod(Tcl_Interp *interp, XOTclObject *object, char *filter); -static int XOTclObjInfoForwardMethod(Tcl_Interp *interp, XOTclObject *object, int withDefinition, char *pattern); +static int XOTclObjInfoForwardMethod(Tcl_Interp *interp, XOTclObject *object, int withDefinition, char *name); static int XOTclObjInfoHasnamespaceMethod(Tcl_Interp *interp, XOTclObject *object); static int XOTclObjInfoInvarMethod(Tcl_Interp *interp, XOTclObject *object); static int XOTclObjInfoMethodsMethod(Tcl_Interp *interp, XOTclObject *object, int withDefined, int withPer_object, int withMethodtype, int withNomixins, int withIncontext, char *pattern); @@ -287,6 +291,7 @@ XOTclCMethodMethodIdx, XOTclCNewMethodIdx, XOTclCRecreateMethodIdx, + XOTclClassInfoAliasMethodIdx, XOTclClassInfoHeritageMethodIdx, XOTclClassInfoInstancesMethodIdx, XOTclClassInfoInstbodyMethodIdx, @@ -307,6 +312,7 @@ XOTclClassInfoSlotsMethodIdx, XOTclClassInfoSubclassMethodIdx, XOTclClassInfoSuperclassMethodIdx, + XOTclObjInfoAliasMethodIdx, XOTclObjInfoBodyMethodIdx, XOTclObjInfoCheckMethodIdx, XOTclObjInfoChildrenMethodIdx, @@ -655,6 +661,27 @@ } static int +XOTclClassInfoAliasMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + parseContext pc; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[XOTclClassInfoAliasMethodIdx].paramDefs, + method_definitions[XOTclClassInfoAliasMethodIdx].nrParameters, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + XOTclClass *object = (XOTclClass *)pc.clientData[0]; + int withDefinition = (int )pc.clientData[1]; + int withPer_object = (int )pc.clientData[2]; + char *name = (char *)pc.clientData[3]; + + parseContextRelease(&pc); + return XOTclClassInfoAliasMethod(interp, object, withDefinition, withPer_object, name); + + } +} + +static int XOTclClassInfoHeritageMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { parseContext pc; @@ -796,10 +823,10 @@ } else { XOTclClass *class = (XOTclClass *)pc.clientData[0]; int withDefinition = (int )pc.clientData[1]; - char *pattern = (char *)pc.clientData[2]; + char *name = (char *)pc.clientData[2]; parseContextRelease(&pc); - return XOTclClassInfoInstforwardMethod(interp, class, withDefinition, pattern); + return XOTclClassInfoInstforwardMethod(interp, class, withDefinition, name); } } @@ -1112,6 +1139,26 @@ } static int +XOTclObjInfoAliasMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { + parseContext pc; + + if (ArgumentParse(interp, objc, objv, NULL, objv[0], + method_definitions[XOTclObjInfoAliasMethodIdx].paramDefs, + method_definitions[XOTclObjInfoAliasMethodIdx].nrParameters, + &pc) != TCL_OK) { + return TCL_ERROR; + } else { + XOTclObject *object = (XOTclObject *)pc.clientData[0]; + int withDefinition = (int )pc.clientData[1]; + char *name = (char *)pc.clientData[2]; + + parseContextRelease(&pc); + return XOTclObjInfoAliasMethod(interp, object, withDefinition, name); + + } +} + +static int XOTclObjInfoBodyMethodStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { parseContext pc; @@ -1256,10 +1303,10 @@ } else { XOTclObject *object = (XOTclObject *)pc.clientData[0]; int withDefinition = (int )pc.clientData[1]; - char *pattern = (char *)pc.clientData[2]; + char *name = (char *)pc.clientData[2]; parseContextRelease(&pc); - return XOTclObjInfoForwardMethod(interp, object, withDefinition, pattern); + return XOTclObjInfoForwardMethod(interp, object, withDefinition, name); } } @@ -2334,6 +2381,12 @@ {"name", 1, 0, convertToTclobj}, {"args", 0, 0, convertToNothing}} }, +{"::xotcl::cmd::ClassInfo::alias", XOTclClassInfoAliasMethodStub, 4, { + {"object", 1, 0, convertToClass}, + {"-definition", 0, 0, convertToString}, + {"-per-object", 0, 0, convertToString}, + {"name", 0, 0, convertToString}} +}, {"::xotcl::cmd::ClassInfo::heritage", XOTclClassInfoHeritageMethodStub, 2, { {"class", 1, 0, convertToClass}, {"pattern", 0, 0, convertToString}} @@ -2363,7 +2416,7 @@ {"::xotcl::cmd::ClassInfo::instforward", XOTclClassInfoInstforwardMethodStub, 3, { {"class", 1, 0, convertToClass}, {"-definition", 0, 0, convertToString}, - {"pattern", 0, 0, convertToString}} + {"name", 0, 0, convertToString}} }, {"::xotcl::cmd::ClassInfo::instinvar", XOTclClassInfoInstinvarMethodStub, 1, { {"class", 1, 0, convertToClass}} @@ -2421,6 +2474,11 @@ {"-closure", 0, 0, convertToString}, {"pattern", 0, 0, convertToTclobj}} }, +{"::xotcl::cmd::ObjectInfo::alias", XOTclObjInfoAliasMethodStub, 3, { + {"object", 1, 0, convertToObject}, + {"-definition", 0, 0, convertToString}, + {"name", 0, 0, convertToString}} +}, {"::xotcl::cmd::ObjectInfo::body", XOTclObjInfoBodyMethodStub, 2, { {"object", 1, 0, convertToObject}, {"methodName", 1, 0, convertToString}} @@ -2452,7 +2510,7 @@ {"::xotcl::cmd::ObjectInfo::forward", XOTclObjInfoForwardMethodStub, 3, { {"object", 1, 0, convertToObject}, {"-definition", 0, 0, convertToString}, - {"pattern", 0, 0, convertToString}} + {"name", 0, 0, convertToString}} }, {"::xotcl::cmd::ObjectInfo::hasnamespace", XOTclObjInfoHasnamespaceMethodStub, 1, { {"object", 1, 0, convertToObject}} Index: generic/xotcl.c =================================================================== diff -u -r15a32e3879e2f837288fa6d362f4a88f63c7e80c -rdb7c710aa3b6386c33af9a318876f21a88b8aafd --- generic/xotcl.c (.../xotcl.c) (revision 15a32e3879e2f837288fa6d362f4a88f63c7e80c) +++ generic/xotcl.c (.../xotcl.c) (revision db7c710aa3b6386c33af9a318876f21a88b8aafd) @@ -9526,14 +9526,37 @@ } static int -ListForward(Tcl_Interp *interp, Tcl_HashTable *table, char *pattern, int definition) { +ListAlias(Tcl_Interp *interp, Tcl_HashTable *table, char *pattern, int withDefinition, + XOTclObject *object, int withPer_object) { int result; - if (definition) { + + if (withDefinition) { Tcl_HashEntry *hPtr = table && pattern ? XOTcl_FindHashEntry(table, pattern) : 0; /* notice: we don't use pattern for wildcard matching here; pattern can only contain wildcards when used without "-definition" */ if (hPtr) { + Tcl_Obj *entryObj = AliasGet(interp, object->cmdName, pattern, withPer_object); + if (entryObj) { + Tcl_SetObjResult(interp, entryObj); + } + } + result = TCL_OK; + } else { + result = ListMethodKeys(interp, table, pattern, XOTCL_METHODTYPE_ALIAS, NULL, object, withPer_object); + } + return result; +} + +static int +ListForward(Tcl_Interp *interp, Tcl_HashTable *table, char *pattern, int withDefinition) { + int result; + if (withDefinition) { + Tcl_HashEntry *hPtr = table && pattern ? XOTcl_FindHashEntry(table, pattern) : 0; + /* notice: we don't use pattern for wildcard matching here; + pattern can only contain wildcards when used without + "-definition" */ + if (hPtr) { Tcl_Command cmd = (Tcl_Command)Tcl_GetHashValue(hPtr); ClientData clientData = cmd? Tcl_Command_objClientData(cmd) : NULL; forwardCmdClientData *tcd = (forwardCmdClientData *)clientData; @@ -9757,12 +9780,12 @@ static int AliasAdd(Tcl_Interp *interp, Tcl_Obj *cmdName, CONST char *methodName, int withPer_object, char *cmd) { Tcl_DString ds, *dsPtr = &ds; - Tcl_Obj *obj = Tcl_SetVar2Ex(interp, "::xotcl::alias", + Tcl_SetVar2Ex(interp, "::xotcl::alias", AliasIndex(dsPtr, cmdName, methodName, withPer_object), Tcl_NewStringObj(cmd,-1), TCL_GLOBAL_ONLY); /*fprintf(stderr, "aliasAdd ::xotcl::alias(%s) '%s' returned %p\n", - AliasIndex(dsPtr, cmdName, methodName, withPer_object), cmd,obj);*/ + AliasIndex(dsPtr, cmdName, methodName, withPer_object), cmd, 1);*/ Tcl_DStringFree(dsPtr); return TCL_OK; } @@ -9773,7 +9796,7 @@ AliasIndex(dsPtr, cmdName, methodName, withPer_object), TCL_GLOBAL_ONLY); /*fprintf(stderr, "aliasDelete ::xotcl::alias(%s) returned %d (%d)\n", - AliasIndex(dsPtr, cmdName, methodName, withPer_object), result, usage);*/ + AliasIndex(dsPtr, cmdName, methodName, withPer_object), result);*/ Tcl_DStringFree(dsPtr); return result; } @@ -12167,6 +12190,11 @@ /*************************** * Begin Object Info Methods ***************************/ +static int XOTclObjInfoAliasMethod(Tcl_Interp *interp, XOTclObject *object, int withDefinition, char *pattern) { + return object->nsPtr ? + ListAlias(interp, Tcl_Namespace_cmdTable(object->nsPtr), pattern, withDefinition, object, 1) : + TCL_OK; +} static int XOTclObjInfoBodyMethod(Tcl_Interp *interp, XOTclObject *object, char *methodName) { Proc *proc = object->nsPtr ? FindProcMethod(object->nsPtr, methodName) : NULL; @@ -12379,6 +12407,14 @@ /*************************** * Begin Class Info methods ***************************/ +static int XOTclClassInfoAliasMethod(Tcl_Interp *interp, XOTclClass *class, + int withDefinition, int withPer_object, char *pattern) { + Tcl_HashTable *table = withPer_object ? + Tcl_Namespace_cmdTable(class->object.nsPtr) : + Tcl_Namespace_cmdTable(class->nsPtr); + return ListAlias(interp, table, pattern, withDefinition, &class->object, withPer_object); +} + static int XOTclClassInfoHeritageMethod(Tcl_Interp *interp, XOTclClass *cl, char *pattern) { XOTclClasses *pl = ComputeOrder(cl, cl->order, Super); Tcl_ResetResult(interp); Index: tests/aliastest.xotcl =================================================================== diff -u -r15a32e3879e2f837288fa6d362f4a88f63c7e80c -rdb7c710aa3b6386c33af9a318876f21a88b8aafd --- tests/aliastest.xotcl (.../aliastest.xotcl) (revision 15a32e3879e2f837288fa6d362f4a88f63c7e80c) +++ tests/aliastest.xotcl (.../aliastest.xotcl) (revision db7c710aa3b6386c33af9a318876f21a88b8aafd) @@ -12,17 +12,22 @@ $t run } +::xotcl::use xotcl1 ::xotcl::use xotcl2 # the system methods of Object are either alias or forwarders ? {lsort [::xotcl::Slot info methods -defined -methodtype alias]} {assign get} +? {::xotcl::Slot info alias -definition get} "::xotcl::setinstvar" +? {::xotcl::Object info alias -definition set} "-objscope ::set" Class create Base Base method foo {{-x 1}} {return $x} Class create Foo ::xotcl::alias ::Foo foo ::xotcl::classes::Base::foo +? {Foo info alias -definition foo} "::xotcl::classes::Base::foo" + Foo create f1 ? {f1 foo} 1 ? {f1 foo -x 2} 2 @@ -34,7 +39,9 @@ ? {Foo info methods -defined -methodtype alias} "" ? {Base info methods -defined -methodtype scripted} {} ? {Foo info methods -defined -methodtype scripted} {} +? {Foo info alias -definition foo} "" + Base method foo {{-x 1}} {return $x} ::xotcl::alias ::Foo foo ::xotcl::classes::Base::foo @@ -69,14 +76,18 @@ ::xotcl::alias T FOO ::xotcl::classes::T::foo ::xotcl::alias S BAR ::xotcl::classes::T::FOO +? {T info methods -defined -methodtype alias} "FOO" +? {T info alias -definition FOO} "::xotcl::classes::T::foo" ? {lsort [T info methods -defined -methodtype scripted]} {FOO foo} ? {S info methods -defined -methodtype scripted} {BAR} T method FOO {} {} ? {T info methods -defined -methodtype scripted} {foo} ? {S info methods -defined -methodtype scripted} {BAR} ? {s BAR} ::S->foo ? {t foo} ::T->foo +? {S info alias -definition BAR} "::xotcl::classes::T::FOO" + T method foo {} {} ? {T info methods -defined -methodtype scripted} {} ? {S info methods -defined -methodtype scripted} {} @@ -100,10 +111,8 @@ ? {lsort [T info methods -defined -per-object -methodtype alias]} {BAR FOO ZAP} ? {lsort [T info methods -per-object -defined -methodtype scripted]} {BAR FOO ZAP bar} ? {t foo} ::T->foo -# -# ISSUE: Why does a [self class] in per-object aliases on method procs -# resolves to [::xotcl::Class] -# +? {T info alias -per-object -definition ZAP} {-per-object ::T::BAR} + ? {T FOO} ->foo ? {T BAR} ->foo ? {T ZAP} ->foo Index: tests/testx.xotcl =================================================================== diff -u -re767edf5c498094f6e00150541bfb7beab52b619 -rdb7c710aa3b6386c33af9a318876f21a88b8aafd --- tests/testx.xotcl (.../testx.xotcl) (revision e767edf5c498094f6e00150541bfb7beab52b619) +++ tests/testx.xotcl (.../testx.xotcl) (revision db7c710aa3b6386c33af9a318876f21a88b8aafd) @@ -3328,7 +3328,7 @@ ::errorCheck [o mixin XY4] ::XY4 " __unknown XY4" } - ::errorCheck [UnknownClass info info] {valid options are: args, body, check, children, class, classchildren, classparent, commands, default, filter, filterguard, forward, hasnamespace, heritage, info, instances, instargs, instbody, instcommands, instdefault, instfilter, instfilterguard, instforward, instinvar, instmixin, instmixinguard, instmixinof, instnonposargs, instparametercmd, instparams, instpost, instpre, instprocs, invar, is, methods, mixin, mixinguard, mixinof, nonposargs, parameter, parametercmd, params, parent, post, pre, precedence, procs, slotobjects, slots, subclass, superclass, vars} "info info" + ::errorCheck [UnknownClass info info] {valid options are: alias, args, body, check, children, class, classchildren, classparent, commands, default, filter, filterguard, forward, hasnamespace, heritage, info, instances, instargs, instbody, instcommands, instdefault, instfilter, instfilterguard, instforward, instinvar, instmixin, instmixinguard, instmixinof, instnonposargs, instparametercmd, instparams, instpost, instpre, instprocs, invar, is, methods, mixin, mixinguard, mixinof, nonposargs, parameter, parametercmd, params, parent, post, pre, precedence, procs, slotobjects, slots, subclass, superclass, vars} "info info" # clear unknown handler to avoid strange results later Class proc __unknown "" ""