Index: ChangeLog =================================================================== diff -u -rd627242b910f2ec0c4a7520089d7ac5f8a9c2395 -r99bd33b963fde1d8c93383fab145234724f2f063 --- ChangeLog (.../ChangeLog) (revision d627242b910f2ec0c4a7520089d7ac5f8a9c2395) +++ ChangeLog (.../ChangeLog) (revision 99bd33b963fde1d8c93383fab145234724f2f063) @@ -1,3 +1,11 @@ +2008-05-30 + * updating language reference + + * Fix contents for %proc in forwarders in cases, + where the forwarder was called via next and + the argument list for next was provided. + Previously, "next" was used for %proc. + 2008-05-28 * make "info (inst)?forward -definition name" more robust (provide an error message, if is nog given @@ -6,8 +14,8 @@ * export *parametercmds in Serializer, use "-noinit" on slots as well 2008-05-26 - * fixed bug in info instdefault, when argument is an empty - string. Example: + * fixed bug in info instdefault, when the given argument name + is an empty string. Example: X info instdefault crash "" var 2008-05-09 Index: doc/langRef.xotcl =================================================================== diff -u -rc2f6b67e7b36f9b7f9e69362420ce572847df18e -r99bd33b963fde1d8c93383fab145234724f2f063 --- doc/langRef.xotcl (.../langRef.xotcl) (revision c2f6b67e7b36f9b7f9e69362420ce572847df18e) +++ doc/langRef.xotcl (.../langRef.xotcl) (revision 99bd33b963fde1d8c93383fab145234724f2f063) @@ -531,6 +531,15 @@ <@li><@TT>objName info filterguard name: Returns the guards for filter identified by name. + <@li><@TT>objName info forward ?-definition name? ?pattern?: + Returns the list of forwarders. One can call this method either + without the optional arguments, or with the <@TT>pattern + or with <@TT>-definition name. When the <@TT>pattern is specified + only the matching forwarders are returned. When the <@TT>definition + option is used together with a name of a forwarder, the definition + of the forwarder with all flags is returned in a way that + can be used e.g. for registering the forwarder on another object. + <@li><@TT>objName info hasNamespace: From XOTcl version 0.9 on, namespaces of objects are allocated on demand. hasNamespace returns 1, if the @@ -562,6 +571,11 @@ <@li><@TT>objName info nonposargs methodName: Returns non-positional arg list of methodName + <@li><@TT>objName info parametercmd ?pattern?: + Returns a list of registered parametercmds the object + (or empty if there are none). If <@TT>pattern + is specified, only the matching parametercmds are returned. + <@li><@TT>objName info parent: Returns parent object name (or "::" for no parent), in fully qualified form. @@ -1067,6 +1081,15 @@ <@li><@TT>objName info instfilterguard name: Returns the guards for instfilter identified by name. + <@li><@TT>objName info instforward ?-definition name? ?pattern?: + Returns the list of instforwarders. One can call this method either + without the optional arguments, or with the <@TT>pattern + or with <@TT>-definition name. When the <@TT>pattern is specified + only the matching instforwarders are returned. When the <@TT>definition + option is used together with a name of a isntforwarder, the definition + of the instforwarder with all flags is returned in a way that + can be used e.g. for registering the instforwarder on another class. + <@li><@TT>ClassName info instinvar: Returns class invariants. @@ -1091,6 +1114,11 @@ <@li><@TT>ClassName info instnonposargs methodName: returns list of non-positional args of methodName + <@li><@TT>objName info instparametercmd ?pattern?: + Returns a list of registered instparametercmds the class + (or empty if there are none). If <@TT>pattern + is specified, only the matching instparametercmds are returned. + <@li><@TT>ClassName info instpost methodName: Returns post assertions of methodName. Index: generic/predefined.xotcl =================================================================== diff -u -rb799293caa03567d1ff1be2ebd991ebf26c449f8 -r99bd33b963fde1d8c93383fab145234724f2f063 --- generic/predefined.xotcl (.../predefined.xotcl) (revision b799293caa03567d1ff1be2ebd991ebf26c449f8) +++ generic/predefined.xotcl (.../predefined.xotcl) (revision 99bd33b963fde1d8c93383fab145234724f2f063) @@ -869,9 +869,7 @@ ::xotcl::Object instproc method {name arguments body} { my proc name $arguments $body } -::xotcl::Class instproc method { - -per-object:switch name arguments body} { - +::xotcl::Class instproc method {-per-object:switch name arguments body} { if {${per-object}} { my proc $name $arguments $body } else { Index: generic/xotcl.c =================================================================== diff -u -rd627242b910f2ec0c4a7520089d7ac5f8a9c2395 -r99bd33b963fde1d8c93383fab145234724f2f063 --- generic/xotcl.c (.../xotcl.c) (revision d627242b910f2ec0c4a7520089d7ac5f8a9c2395) +++ generic/xotcl.c (.../xotcl.c) (revision 99bd33b963fde1d8c93383fab145234724f2f063) @@ -6696,7 +6696,7 @@ int result = TCL_OK, frameType = XOTCL_CSC_TYPE_PLAIN, isMixinEntry = 0, isFilterEntry = 0, - endOfFilterChain = 0; + endOfFilterChain = 0, decrObjv0 = 0; int nobjc; Tcl_Obj **nobjv; XOTclClass **cl = &givenCl; char **method = &givenMethod; @@ -6742,6 +6742,16 @@ } else { nobjc = objc; nobjv = (Tcl_Obj **)objv; + /* We do not want to have "next" as the procname, since this can + lead to unwanted results e.g. in a forwarder using %proc. So, we + replace the first word with the value from the callstack to be + compatible with the case where next is called without args. + */ + if (useCallstackObjs && csc->currentFramePtr) { + nobjv[0] = Tcl_CallFrame_objv(csc->currentFramePtr)[0]; + INCR_REF_COUNT(nobjv[0]); /* we seem to need this here */ + decrObjv0 = 1; + } } /* @@ -6804,7 +6814,6 @@ csc->callType |= XOTCL_CSC_CALL_IS_NEXT; RUNTIME_STATE(interp)->unknown = 0; - result = DoCallProcCheck(cp, (ClientData)obj, interp, nobjc, nobjv, cmd, obj, *cl, *method, frameType, 1/*fromNext*/); @@ -6819,6 +6828,9 @@ RUNTIME_STATE(interp)->unknown = 1; } + if (decrObjv0) { + INCR_REF_COUNT(nobjv[0]); + } return result; } @@ -8424,11 +8436,11 @@ int definition; if (argc < 2 || argc > 3) return XOTclObjErrArgCnt(interp, obj->cmdName, - "info forward ?-definition? ?name?"); + "info forward ?-definition name? ?pattern?"); definition = checkForModifier(objv, modifiers, "-definition"); if (definition && argc < 3) return XOTclObjErrArgCnt(interp, obj->cmdName, - "info forward ?-definition? ?name?"); + "info forward ?-definition name? ?pattern?"); if (nsp) { return forwardList(interp, Tcl_Namespace_cmdTable(nsp), pattern, definition); } else { @@ -8571,7 +8583,7 @@ int argc = objc-modifiers; if (argc < 2) return XOTclObjErrArgCnt(interp, obj->cmdName, - "info parametercmd"); + "info parametercmd ?pattern?"); if (nsp) { return ListMethodKeys(interp, Tcl_Namespace_cmdTable(nsp), pattern, 1, 0, 0, 0, 1); } else { @@ -10968,7 +10980,7 @@ int argc = objc-modifiers; if (argc < 2) return XOTclObjErrArgCnt(interp, cl->object.cmdName, - "info instparametercmd"); + "info instparametercmd ?pattern?"); if (nsp) { return ListMethodKeys(interp, Tcl_Namespace_cmdTable(nsp), pattern, 1, 0, 0, 0, 1); } else {