Posted to tcl by apw at Mon Sep 03 15:02:07 GMT 2007view pretty
Hi Miguel, I have thought about a different api for var resolving: what about the following, for the first init of a proc: int Custom_ResolveVarsInit( Tcl_Interp *interp, Tcl_Namespace *nsPtr, const char * varNames[], ClientData * resolveInfos) { /* foreach varname in varNames return ClientData for runtime resolving */ /* varNames is NULL terminated and contains all the names of the * compiled vars, VAR_TEMPORARY are omitted or alternatively, if * first character is \0 it is a VAR_TEMPORARY */ return TCL_OK; } for the runtime setting/linking of vars when calling proc afterwards: int Custom_ResolveVarLinks( Tcl_Interp *interp, Tcl_Namespace *nsPtr, ClientData * resolveInfos, Tcl_Var *varPtrPtr) { /* foreach ClientData in resolveInfos fill in a varPtr * (or NULL if not wanted) into varPtrPtr array, which is the variable * the varPtr of CompiledVars should be linked to */ retrun TCL_OK; } What is your opinion to such an api?