From: SourceForge.net <no...@so...> - 2007-08-31 17:34:43
|
Feature Requests item #1779249, was opened at 2007-08-22 10:23 Message generated for change (Comment added) made by wiede You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=1779249&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 44. Parsing and Eval Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Arnulf Wiedemann (wiede) Assigned to: miguel sofer (msofer) Summary: alternate var and command resolver Initial Comment: The purpose of this RFE is to to provide a different api for namespace/interp variable and command resolvers. It is based on a CallFrame dependent interface, so only commands which want to use it will get involved. The idea is for variables to look them up in a different namespace, for commands to look up constructs like ns1::command1 (no :: at the beginning!!) in a different namespace, which cannot be handled by namespace path. For Itcl the usage is tohave all variables in subnamespaces of i.e. ::itcl::variables in an object specific namespace with the class namespace as a subnamespace for every class in the objects hierarchy ::itcl::variables::object1::class1::var1 ::itcl::variables::object1::class2::var2 ::itcl::variables::object2::class1::var1 for classes special command lookup for commands works as follows: object1 class1::command1 will find a command in i.e. ::ns1::ns2::class1 and object1 class2::command2 will find a command in ::ns3::class2 The resolution using the stored resolvers is done using Tcl_FindCommand and Tcl_FindNamespaceVar. The call of these functions is dependent on a flag like FRAME_HAS_RESOLVER which has to be put into isProcCallFraem from the caller of the command (so it is only working locally) A prototype implementation can be found in the attached file (this has been tested with a new Itcl implementation) ---------------------------------------------------------------------- >Comment By: Arnulf Wiedemann (wiede) Date: 2007-08-31 19:34 Message: Logged In: YES user_id=558925 Originator: YES dgp, sorry there is a one line bug in the attachement: @@ -1257,6 +1260,23 @@ localPtr->flags |= VAR_RESOLVED; } } if (frame_has_resolver && !(localPtr->flags & (VAR_ARGUMENT|VAR_TEMPORARY)) && (iPtr->varFramePtr->resolvePtr != NULL)) { - *resolvePtr = iPtr->varFramePtr->resolvePtr; + Tcl_Resolve *resolvePtr = iPtr->varFramePtr->resolvePtr; varPtr->flags = localPtr->flags; varPtr->value.objPtr = NULL; if (resolvePtr->varProcPtr != NULL) { Var *resolvedVarPtr; Arnulf ---------------------------------------------------------------------- Comment By: Arnulf Wiedemann (wiede) Date: 2007-08-31 19:17 Message: Logged In: YES user_id=558925 Originator: YES File Added: diff_resolver_20070831.txt ---------------------------------------------------------------------- Comment By: Arnulf Wiedemann (wiede) Date: 2007-08-30 23:13 Message: Logged In: YES user_id=558925 Originator: YES I will add an uptodate patch Arnulf ---------------------------------------------------------------------- Comment By: Don Porter (dgp) Date: 2007-08-30 18:35 Message: Logged In: YES user_id=80530 Originator: NO The patch appears to be damaged. Can you supply one that applies to the current Tcl HEAD please? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=360894&aid=1779249&group_id=10894 |