Index: TODO =================================================================== diff -u -r8274c68ad85f12b1e4a41a01273079405fa865ef -r89b5047e54e47a88a7de75d8523a07ffa5743407 --- TODO (.../TODO) (revision 8274c68ad85f12b1e4a41a01273079405fa865ef) +++ TODO (.../TODO) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) @@ -958,8 +958,38 @@ - extended regression test - fixed serializer to handle subobjects of explicitely exported objects +- xotcl.c: + * new function GetObjectFromNsName() to obtail object or class + from a fully qualified namespace name used in method handles (such as e.g. + ::nx::core::classes::X) + * new function MethodHandleObj() to return a tcl_obj containing the methodhandle + * removed obsolete method getFullProcQualifier() + * info methods obtain now object and/or class from fully qualified method + names (method handles) if possible + * return message handles in "current next", "current filterreg" and + "... info filter ... -order", which can be used in "info method .... " + for obtaining more details. + * change all occurrances of "self" in next regression tests to current. +- xotcl2.tcl + * implemented "self" as a proc to provide extensibility and + full backward compatibilty; this opens opportunity + to replace now e.g. "self proc" by "current method", etc. + * provide full compatibility for "self next", "self filterreg" and + "... info filter ... -order", returning old-style multiword method handles + (such as e.g. "::C instproc foo") +- changed "next" to current in documentation framework and templates + + TODO: - nameing + * self/current: + - overthink general replacement of "self" by "current". + a consequence is, that slots can't use "self" anymore, since slots + are always next objects + - replace "self proc" by "current method", etc. + - we have "%self" as well, which is better than "%current" + - maybe provide alias "self" for "current object" + * .c-code: . rename source files from xotcl{Int}.{ch}->next*.* | next-scripting*.* ? Stefan, meinung dazu? Notwending|Empfehlenswert|nicht? Index: generic/gentclAPI.decls =================================================================== diff -u -r8f2c993e02fe43f23c7e1653d05f6e298c23b2b2 -r89b5047e54e47a88a7de75d8523a07ffa5743407 --- generic/gentclAPI.decls (.../gentclAPI.decls) (revision 8f2c993e02fe43f23c7e1653d05f6e298c23b2b2) +++ generic/gentclAPI.decls (.../gentclAPI.decls) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) @@ -260,9 +260,7 @@ # @subcommand filterreg In a method serving as active filter, returns the name of the object (class) on which the method is registered as a filter. # @subcommand callinglevel Returns the "original" callstack level calling into the executing method. Intermediary {{{next}}} calls are ignored in this computation. The level is returned in a form so that it can be used as first argument in {{@method ::nx::Object class uplevel}} or {{@method ::nx::Object class upvar}}. # @subcommand activelevel Returns the actual callstack level calling into the executing method. The active might correspond the {{{callinglevel}}}, but this is not necessarily the case. The {{{activelevel}}} counts {{@command ::nx::next}} call. The level is returned in a form so that it can be used as first argument in {{@method ::nx::Object class uplevel}} or {{@method ::nx::Object class upvar}}. -xotclCmd self XOTclSelfCmd { - {-argName "selfoption" -required 0 -type "proc|method|object|class|activelevel|args|activemixin|calledproc|calledmethod|calledclass|callingproc|callingmethod|callingclass|callinglevel|callingobject|filterreg|isnextcall|next"} -} + xotclCmd setvar XOTclSetVarCmd { {-argName "object" -required 1 -type object} {-argName "variable" -required 1 -type tclobj} Index: generic/predefined.h =================================================================== diff -u -r8f2c993e02fe43f23c7e1653d05f6e298c23b2b2 -r89b5047e54e47a88a7de75d8523a07ffa5743407 --- generic/predefined.h (.../predefined.h) (revision 8f2c993e02fe43f23c7e1653d05f6e298c23b2b2) +++ generic/predefined.h (.../predefined.h) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) @@ -16,9 +16,8 @@ "-object.residualargs residualargs\n" "-object.unknown unknown}\n" "namespace eval ::nx::core {\n" -"namespace export next self \\\n" -"my is relation interp}\n" -"namespace import ::nx::core::next ::nx::core::self\n" +"namespace export next current my is relation interp}\n" +"namespace import ::nx::core::next ::nx::core::current\n" "foreach cmd [info command ::nx::core::cmd::Object::*] {\n" "set cmdName [namespace tail $cmd]\n" "if {$cmdName in [list \"exists\" \"instvar\"]} continue\n" Index: generic/predefined.tcl =================================================================== diff -u -r8f2c993e02fe43f23c7e1653d05f6e298c23b2b2 -r89b5047e54e47a88a7de75d8523a07ffa5743407 --- generic/predefined.tcl (.../predefined.tcl) (revision 8f2c993e02fe43f23c7e1653d05f6e298c23b2b2) +++ generic/predefined.tcl (.../predefined.tcl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) @@ -27,15 +27,13 @@ } # - # get frequenly used primitiva into the ::next namespace + # get frequenly used primitiva into the ::nx::core namespace # namespace eval ::nx::core { - namespace export next self \ - my is relation interp + namespace export next current my is relation interp } - - namespace import ::nx::core::next ::nx::core::self + namespace import ::nx::core::next ::nx::core::current # # provide the standard command set for ::nx::Object Index: generic/tclAPI.h =================================================================== diff -u -r8f2c993e02fe43f23c7e1653d05f6e298c23b2b2 -r89b5047e54e47a88a7de75d8523a07ffa5743407 --- generic/tclAPI.h (.../tclAPI.h) (revision 8f2c993e02fe43f23c7e1653d05f6e298c23b2b2) +++ generic/tclAPI.h (.../tclAPI.h) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) @@ -109,17 +109,6 @@ } enum RelationtypeIdx {RelationtypeNULL, RelationtypeObject_mixinIdx, RelationtypeClass_mixinIdx, RelationtypeObject_filterIdx, RelationtypeClass_filterIdx, RelationtypeClassIdx, RelationtypeSuperclassIdx, RelationtypeRootclassIdx}; -static int convertToSelfoption(Tcl_Interp *interp, Tcl_Obj *objPtr, XOTclParam CONST *pPtr, - ClientData *clientData, Tcl_Obj **outObjPtr) { - int index, result; - static CONST char *opts[] = {"proc", "method", "object", "class", "activelevel", "args", "activemixin", "calledproc", "calledmethod", "calledclass", "callingproc", "callingmethod", "callingclass", "callinglevel", "callingobject", "filterreg", "isnextcall", "next", NULL}; - result = Tcl_GetIndexFromObj(interp, objPtr, opts, "selfoption", 0, &index); - *clientData = (ClientData) INT2PTR(index + 1); - *outObjPtr = objPtr; - return result; -} -enum SelfoptionIdx {SelfoptionNULL, SelfoptionProcIdx, SelfoptionMethodIdx, SelfoptionObjectIdx, SelfoptionClassIdx, SelfoptionActivelevelIdx, SelfoptionArgsIdx, SelfoptionActivemixinIdx, SelfoptionCalledprocIdx, SelfoptionCalledmethodIdx, SelfoptionCalledclassIdx, SelfoptionCallingprocIdx, SelfoptionCallingmethodIdx, SelfoptionCallingclassIdx, SelfoptionCallinglevelIdx, SelfoptionCallingobjectIdx, SelfoptionFilterregIdx, SelfoptionIsnextcallIdx, SelfoptionNextIdx}; - typedef struct { CONST char *methodName; @@ -220,7 +209,6 @@ static int XOTclParametercheckCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclQualifyObjCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclRelationCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); -static int XOTclSelfCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclSetVarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); static int XOTclSetterCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv []); @@ -299,7 +287,6 @@ static int XOTclParametercheckCmd(Tcl_Interp *interp, int withNocomplain, Tcl_Obj *param, Tcl_Obj *value); static int XOTclQualifyObjCmd(Tcl_Interp *interp, Tcl_Obj *name); static int XOTclRelationCmd(Tcl_Interp *interp, XOTclObject *object, int relationtype, Tcl_Obj *value); -static int XOTclSelfCmd(Tcl_Interp *interp, int selfoption); static int XOTclSetVarCmd(Tcl_Interp *interp, XOTclObject *object, Tcl_Obj *variable, Tcl_Obj *value); static int XOTclSetterCmd(Tcl_Interp *interp, XOTclObject *object, int withPer_object, Tcl_Obj *parameter); @@ -379,7 +366,6 @@ XOTclParametercheckCmdIdx, XOTclQualifyObjCmdIdx, XOTclRelationCmdIdx, - XOTclSelfCmdIdx, XOTclSetVarCmdIdx, XOTclSetterCmdIdx } XOTclMethods; @@ -1886,24 +1872,6 @@ } static int -XOTclSelfCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { - parseContext pc; - - if (ArgumentParse(interp, objc, objv, NULL, objv[0], - method_definitions[XOTclSelfCmdIdx].paramDefs, - method_definitions[XOTclSelfCmdIdx].nrParameters, - &pc) != TCL_OK) { - return TCL_ERROR; - } else { - int selfoption = (int )PTR2INT(pc.clientData[0]); - - parseContextRelease(&pc); - return XOTclSelfCmd(interp, selfoption); - - } -} - -static int XOTclSetVarCmdStub(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[]) { parseContext pc; @@ -2287,9 +2255,6 @@ {"relationtype", 1, 0, convertToRelationtype}, {"value", 0, 0, convertToTclobj}} }, -{"::nx::core::self", XOTclSelfCmdStub, 1, { - {"selfoption", 0, 0, convertToSelfoption}} -}, {"::nx::core::setvar", XOTclSetVarCmdStub, 3, { {"object", 1, 0, convertToObject}, {"variable", 1, 0, convertToTclobj}, Index: generic/xotcl.c =================================================================== diff -u -r8274c68ad85f12b1e4a41a01273079405fa865ef -r89b5047e54e47a88a7de75d8523a07ffa5743407 --- generic/xotcl.c (.../xotcl.c) (revision 8274c68ad85f12b1e4a41a01273079405fa865ef) +++ generic/xotcl.c (.../xotcl.c) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) @@ -496,6 +496,21 @@ return string+19; } +XOTCLINLINE static XOTclObject * +GetObjectFromNsName(Tcl_Interp *interp, CONST char *string, int *fromClassNS) { + /* + * Get object or class from a fully qualified cmd name, such as + * e.g. ::nx::core::classes::X + */ + if (isClassName(string)) { + *fromClassNS = 1; + return (XOTclObject *)XOTclpGetClass(interp, NSCutXOTclClasses(string)); + } else { + *fromClassNS = 0; + return XOTclpGetObject(interp, string); + } +} + XOTCLINLINE static char * NSCmdFullName(Tcl_Command cmd) { Tcl_Namespace *nsPtr = Tcl_Command_nsPtr(cmd); @@ -4523,55 +4538,34 @@ cl->order = saved; } -/* - * Build up a qualifier of the form method . - * If cl is NULL, we add the modifier "object". - */ static Tcl_Obj * -getFullProcQualifier(Tcl_Interp *interp, CONST char *cmdName, - XOTclObject *object, XOTclClass *cl, Tcl_Command cmd) { - Tcl_Obj *list = Tcl_NewListObj(0, NULL); - Tcl_Obj *procObj = Tcl_NewStringObj(cmdName, -1); - Tcl_ObjCmdProc *objProc = Tcl_Command_objProc(cmd); - int isTcl = CmdIsProc(cmd); - - if (cl) { - Tcl_ListObjAppendElement(interp, list, cl->object.cmdName); - } else { - Tcl_ListObjAppendElement(interp, list, object->cmdName); - Tcl_ListObjAppendElement(interp, list, XOTclGlobalObjs[XOTE_OBJECT]); - } - if (isTcl) { - Tcl_ListObjAppendElement(interp, list, XOTclGlobalObjs[XOTE_METHOD]); - } else if (objProc == XOTclForwardMethod) { - Tcl_ListObjAppendElement(interp, list, XOTclGlobalObjs[XOTE_FORWARD]); - } else if (objProc == XOTclSetterMethod) { - Tcl_ListObjAppendElement(interp, list, XOTclGlobalObjs[XOTE_SETTER]); - } else { - Tcl_ListObjAppendElement(interp, list, XOTclGlobalObjs[XOTE_CMD]); - } - Tcl_ListObjAppendElement(interp, list, procObj); - return list; +MethodHandleObj(XOTclObject *object, int withPer_object, CONST char *methodName) { + Tcl_Obj *resultObj = Tcl_NewStringObj(withPer_object ? "" : "::nx::core::classes", -1); + assert(object); + Tcl_AppendObjToObj(resultObj, object->cmdName); + Tcl_AppendStringsToObj(resultObj, "::", methodName, (char *) NULL); + return resultObj; } /* * info option for filters and classfilters * withGuards -> if not 0 => append guards - * fullProcQualifiers -> if not 0 => full names with obj/class method + * withMethodHandles -> if not 0 => return method handles */ static int FilterInfo(Tcl_Interp *interp, XOTclCmdList *f, CONST char *pattern, - int withGuards, int fullProcQualifiers) { + int withGuards, int withMethodHandles) { CONST char *simpleName; Tcl_Obj *list = Tcl_NewListObj(0, NULL); - /*fprintf(stderr, "FilterInfo %p %s %d %d\n", pattern, pattern, withGuards, fullProcQualifiers);*/ + /*fprintf(stderr, "FilterInfo %p %s %d %d\n", pattern, pattern, + withGuards, withMethodHandles);*/ - /* guard lists should only have unqualified filter lists - when withGuards is activated, fullProcQualifiers has not - effect */ + /* guard lists should only have unqualified filter lists when + withGuards is activated, withMethodHandles has no effect + */ if (withGuards) { - fullProcQualifiers = 0; + withMethodHandles = 0; } while (f) { @@ -4586,19 +4580,11 @@ Tcl_ListObjAppendElement(interp, innerList, g); Tcl_ListObjAppendElement(interp, list, innerList); } else { - if (fullProcQualifiers) { - XOTclClass *filterClass; - XOTclObject *filterObject; - if (f->clorobj && !XOTclObjectIsClass(&f->clorobj->object)) { - filterObject = (XOTclObject *)f->clorobj; - filterClass = NULL; - } else { - filterObject = NULL; - filterClass = f->clorobj; - } + if (withMethodHandles) { + XOTclClass *filterClass = f->clorobj; Tcl_ListObjAppendElement(interp, list, - getFullProcQualifier(interp, simpleName, - filterObject, filterClass, f->cmdPtr)); + MethodHandleObj((XOTclObject *)filterClass, + !XOTclObjectIsClass(&filterClass->object), simpleName)); } else { Tcl_ListObjAppendElement(interp, list, Tcl_NewStringObj(simpleName, -1)); } @@ -7430,15 +7416,15 @@ Tcl_ResetResult(interp); methodName = (char *)Tcl_GetCommandName(interp, cscPtr->cmdPtr); - if (!methodName) + if (!methodName) { return TCL_OK; + } result = NextSearchMethod(object, interp, cscPtr, &cl, &methodName, &cmd, &isMixinEntry, &isFilterEntry, &endOfFilterChain, ¤tCmd); - if (cmd) { - Tcl_SetObjResult(interp, getFullProcQualifier(interp, Tcl_GetCommandName(interp, cmd), - object, cl, cmd)); + Tcl_SetObjResult(interp, MethodHandleObj(cl ? (XOTclObject*)cl : object, + cl == NULL, methodName)); } return result; } @@ -9967,14 +9953,10 @@ static int ListMethodName(Tcl_Interp *interp, XOTclObject *object, int withPer_object, CONST char *methodName) { - Tcl_Obj *resultObj = Tcl_NewStringObj(withPer_object ? "" : "::nx::core::classes", -1); - Tcl_AppendObjToObj(resultObj, object->cmdName); - Tcl_AppendStringsToObj(resultObj, "::", methodName, (char *) NULL); - Tcl_SetObjResult(interp, resultObj); + Tcl_SetObjResult(interp, MethodHandleObj(object, withPer_object, methodName)); return TCL_OK; } - static int ListMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *methodName, Tcl_Command cmd, int subcmd, int withPer_object) { @@ -9989,6 +9971,38 @@ int outputPerObject = 0; Tcl_Obj *resultObj; + if (*methodName == ':') { + /* + * We have a fully qualified method name, maybe an object handle + */ + CONST char *procName = Tcl_GetCommandName(interp, cmd); + size_t objNameLength = strlen(methodName) - strlen(procName) - 2; + Tcl_DString ds, *dsPtr = &ds; + + if (objNameLength > 0) { + XOTclObject *object1; + int fromClassNS; + + Tcl_DStringInit(dsPtr); + Tcl_DStringAppend(dsPtr, methodName, objNameLength); + object1 = GetObjectFromNsName(interp, Tcl_DStringValue(dsPtr), &fromClassNS); + if (object1) { + /* + * The command was from an object, return therefore this + * object as reference. + */ + /*fprintf(stderr, "We are flipping the object to %s, method %s to %s\n", + objectName(object1), methodName, procName);*/ + object = object1; + methodName = procName; + if (!fromClassNS) { + withPer_object = 1; + } + } + Tcl_DStringFree(dsPtr); + } + } + if (!XOTclObjectIsClass(object)) { withPer_object = 1; /* don't output "object" modifier, if object is not a class */ @@ -11056,7 +11070,6 @@ Tcl_DeleteNamespace(RUNTIME_STATE(interp)->XOTclClassesNS); Tcl_DeleteNamespace(RUNTIME_STATE(interp)->XOTclNS); #endif - /*xxxx*/ return TCL_OK; } @@ -11423,25 +11436,24 @@ Tcl_HashEntry *hPtr; XOTclObject *object; XOTclClass *cl; + int fromClassNS; fromNsPtr = ObjFindNamespace(interp, fromNs); if (!fromNsPtr) return TCL_OK; name = ObjStr(fromNs); + /* check, if we work on an object or class namespace */ - if (isClassName(name)) { - cl = XOTclpGetClass(interp, NSCutXOTclClasses(name)); - object = (XOTclObject *)cl; - } else { - cl = NULL; - object = XOTclpGetObject(interp, name); - } + object = GetObjectFromNsName(interp, name, &fromClassNS); if (object == NULL) { return XOTclVarErrMsg(interp, "CopyCmds argument 1 (", ObjStr(fromNs), ") is not an object", NULL); } + + cl = fromClassNS ? (XOTclClass *)object : NULL; + /* object = XOTclpGetObject(interp, ObjStr(fromNs));*/ toNsPtr = ObjFindNamespace(interp, toNs); @@ -12035,21 +12047,18 @@ } /* -xotclCmd self XOTclGetSelfObjCmd { - {-argName "selfoption" -required 0 -type "proc|class|activelevel|args|activemixin|calledproc|calledmethod|calledclass|callingproc|callingclass|callinglevel|callingobject|filterreg|isnextcall|next"} +xotclCmd current XOTclCurrentCmd { + {-argName "currentoption" -required 0 -type "proc|method|object|class|activelevel|args|activemixin|calledproc|calledmethod|calledclass|callingproc|callingmethod|callingclass|callinglevel|callingobject|filterreg|isnextcall|next"} } */ -static int XOTclSelfCmd(Tcl_Interp *interp, int selfoption) { - return XOTclCurrentCmd(interp, selfoption); -} static int XOTclCurrentCmd(Tcl_Interp *interp, int selfoption) { XOTclObject *object = GetSelfObj(interp); XOTclCallStackContent *cscPtr; int result = TCL_OK; /*fprintf(stderr, "getSelfObj returns %p\n", object); tcl85showStack(interp);*/ - if (selfoption == 0 || selfoption == SelfoptionObjectIdx) { + if (selfoption == 0 || selfoption == CurrentoptionObjectIdx) { if (object) { Tcl_SetObjResult(interp, object->cmdName); return TCL_OK; @@ -12058,13 +12067,13 @@ } } - if (!object && selfoption != SelfoptionCallinglevelIdx) { + if (!object && selfoption != CurrentoptionCallinglevelIdx) { return XOTclVarErrMsg(interp, "No current object", (char *) NULL); } switch (selfoption) { - case SelfoptionMethodIdx: /* fall through */ - case SelfoptionProcIdx: + case CurrentoptionMethodIdx: /* fall through */ + case CurrentoptionProcIdx: cscPtr = CallStackGetTopFrame(interp, NULL); if (cscPtr) { CONST char *procName = Tcl_GetCommandName(interp, cscPtr->cmdPtr); @@ -12074,16 +12083,16 @@ } break; - case SelfoptionClassIdx: /* class subcommand */ + case CurrentoptionClassIdx: /* class subcommand */ cscPtr = CallStackGetTopFrame(interp, NULL); Tcl_SetObjResult(interp, cscPtr->cl ? cscPtr->cl->object.cmdName : XOTclGlobalObjs[XOTE_EMPTY]); break; - case SelfoptionActivelevelIdx: + case CurrentoptionActivelevelIdx: Tcl_SetObjResult(interp, computeLevelObj(interp, ACTIVE_LEVEL)); break; - case SelfoptionArgsIdx: { + case CurrentoptionArgsIdx: { int nobjc; Tcl_Obj **nobjv; Tcl_CallFrame *topFramePtr; @@ -12100,7 +12109,7 @@ break; } - case SelfoptionActivemixinIdx: { + case CurrentoptionActivemixinIdx: { XOTclObject *object = NULL; if (RUNTIME_STATE(interp)->cmdPtr) { object = XOTclGetObjectFromCmdPtr(RUNTIME_STATE(interp)->cmdPtr); @@ -12109,8 +12118,8 @@ break; } - case SelfoptionCalledprocIdx: - case SelfoptionCalledmethodIdx: + case CurrentoptionCalledprocIdx: + case CurrentoptionCalledmethodIdx: cscPtr = CallStackFindActiveFilter(interp); if (cscPtr) { Tcl_SetObjResult(interp, cscPtr->filterStackEntry->calledProc); @@ -12120,37 +12129,37 @@ } break; - case SelfoptionCalledclassIdx: + case CurrentoptionCalledclassIdx: Tcl_SetResult(interp, className(FindCalledClass(interp, object)), TCL_VOLATILE); break; - case SelfoptionCallingmethodIdx: - case SelfoptionCallingprocIdx: + case CurrentoptionCallingmethodIdx: + case CurrentoptionCallingprocIdx: cscPtr = XOTclCallStackFindLastInvocation(interp, 1, NULL); Tcl_SetResult(interp, cscPtr ? (char *)Tcl_GetCommandName(interp, cscPtr->cmdPtr) : "", TCL_VOLATILE); break; - case SelfoptionCallingclassIdx: + case CurrentoptionCallingclassIdx: cscPtr = XOTclCallStackFindLastInvocation(interp, 1, NULL); Tcl_SetObjResult(interp, cscPtr && cscPtr->cl ? cscPtr->cl->object.cmdName : XOTclGlobalObjs[XOTE_EMPTY]); break; - case SelfoptionCallinglevelIdx: + case CurrentoptionCallinglevelIdx: if (!object) { Tcl_SetIntObj(Tcl_GetObjResult(interp), 1); } else { Tcl_SetObjResult(interp, computeLevelObj(interp, CALLING_LEVEL)); } break; - case SelfoptionCallingobjectIdx: + case CurrentoptionCallingobjectIdx: cscPtr = XOTclCallStackFindLastInvocation(interp, 1, NULL); Tcl_SetObjResult(interp, cscPtr ? cscPtr->self->cmdName : XOTclGlobalObjs[XOTE_EMPTY]); break; - case SelfoptionFilterregIdx: + case CurrentoptionFilterregIdx: cscPtr = CallStackFindActiveFilter(interp); if (cscPtr) { Tcl_SetObjResult(interp, FilterFindReg(interp, object, cscPtr->cmdPtr)); @@ -12161,7 +12170,7 @@ } break; - case SelfoptionIsnextcallIdx: { + case CurrentoptionIsnextcallIdx: { Tcl_CallFrame *framePtr; cscPtr = CallStackGetTopFrame(interp, &framePtr); framePtr = nextFrameOfType(Tcl_CallFrame_callerPtr(framePtr), FRAME_IS_XOTCL_METHOD|FRAME_IS_XOTCL_CMETHOD); @@ -12172,7 +12181,7 @@ break; } - case SelfoptionNextIdx: + case CurrentoptionNextIdx: result = FindSelfNext(interp); break; } @@ -12786,9 +12795,9 @@ * if it is not found it returns an empty string */ static int XOTclOFilterSearchMethod(Tcl_Interp *interp, XOTclObject *object, CONST char *filter) { + CONST char *filterName; XOTclCmdList *cmdList; XOTclClass *fcl; - XOTclObject *fobj; Tcl_ResetResult(interp); @@ -12798,7 +12807,7 @@ return TCL_OK; for (cmdList = object->filterOrder; cmdList; cmdList = cmdList->nextPtr) { - CONST char *filterName = Tcl_GetCommandName(interp, cmdList->cmdPtr); + filterName = Tcl_GetCommandName(interp, cmdList->cmdPtr); if (filterName[0] == filter[0] && !strcmp(filterName, filter)) break; } @@ -12807,16 +12816,7 @@ return TCL_OK; fcl = cmdList->clorobj; - if (fcl && XOTclObjectIsClass(&fcl->object)) { - fobj = NULL; - } else { - fobj = (XOTclObject*)fcl; - fcl = NULL; - } - - Tcl_SetObjResult(interp, getFullProcQualifier(interp, filter, fobj, fcl, - cmdList->cmdPtr)); - return TCL_OK; + return ListMethodName(interp, (XOTclObject*)fcl, !XOTclObjectIsClass(&fcl->object), filterName); } static int XOTclOInstVarMethod(Tcl_Interp *interp, XOTclObject *object, int objc, Tcl_Obj *CONST objv[]) { @@ -14682,12 +14682,12 @@ #endif Tcl_CreateObjCommand(interp, "::nx::core::next", XOTclNextObjCmd, 0, 0); #ifdef XOTCL_BYTECODE - instructions[INST_SELF].cmdPtr = (Command *)Tcl_FindCommand(interp, "::nx::core::self", 0, 0); + instructions[INST_SELF].cmdPtr = (Command *)Tcl_FindCommand(interp, "::nx::core::current", 0, 0); #endif /*Tcl_CreateObjCommand(interp, "::nx::core::K", XOTclKObjCmd, 0, 0);*/ Tcl_CreateObjCommand(interp, "::nx::core::unsetUnknownArgs", XOTclUnsetUnknownArgsCmd, 0, 0); - Tcl_Export(interp, RUNTIME_STATE(interp)->XOTclNS, "self", 0); + Tcl_Export(interp, RUNTIME_STATE(interp)->XOTclNS, "current", 0); Tcl_Export(interp, RUNTIME_STATE(interp)->XOTclNS, "next", 0); Tcl_Export(interp, RUNTIME_STATE(interp)->XOTclNS, "my", 0); Tcl_Export(interp, RUNTIME_STATE(interp)->XOTclNS, "importvar", 0); Index: generic/xotclStack85.c =================================================================== diff -u -r224d1a24b787b67fb9f0ff8a894f3092e8e4d5ae -r89b5047e54e47a88a7de75d8523a07ffa5743407 --- generic/xotclStack85.c (.../xotclStack85.c) (revision 224d1a24b787b67fb9f0ff8a894f3092e8e4d5ae) +++ generic/xotclStack85.c (.../xotclStack85.c) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) @@ -329,6 +329,9 @@ } } + +#if 0 +/* just used by XOTclONextMethod() */ static XOTclCallStackContent* CallStackGetObjectFrame(Tcl_Interp *interp, XOTclObject *object) { register Tcl_CallFrame *varFramePtr = (Tcl_CallFrame *)Tcl_Interp_varFramePtr(interp); @@ -343,6 +346,7 @@ } return NULL; } +#endif /* * Pop any callstack entry that is still alive (e.g. Index: library/lib/doc-assets/entity.html.tmpl =================================================================== diff -u -r783648c4c7132adc4a447faa69d6e4e12b621c46 -r89b5047e54e47a88a7de75d8523a07ffa5743407 --- library/lib/doc-assets/entity.html.tmpl (.../entity.html.tmpl) (revision 783648c4c7132adc4a447faa69d6e4e12b621c46) +++ library/lib/doc-assets/entity.html.tmpl (.../entity.html.tmpl) (revision 89b5047e54e47a88a7de75d8523a07ffa5743407) @@ -68,7 +68,7 @@