Posted to tcl by apw at Mon Sep 03 15:02:07 GMT 2007view raw

  1. Hi Miguel,
  2.  
  3. I have thought about a different api for var resolving:
  4.  
  5. what about the following, for the first init of a proc:
  6.  
  7. int
  8. Custom_ResolveVarsInit(
  9. Tcl_Interp *interp,
  10. Tcl_Namespace *nsPtr,
  11. const char * varNames[],
  12. ClientData * resolveInfos)
  13. {
  14. /* foreach varname in varNames return ClientData for runtime resolving */
  15. /* varNames is NULL terminated and contains all the names of the
  16. * compiled vars, VAR_TEMPORARY are omitted or alternatively, if
  17. * first character is \0 it is a VAR_TEMPORARY */
  18.  
  19. return TCL_OK;
  20. }
  21.  
  22. for the runtime setting/linking of vars when calling proc afterwards:
  23.  
  24.  
  25. int
  26. Custom_ResolveVarLinks(
  27. Tcl_Interp *interp,
  28. Tcl_Namespace *nsPtr,
  29. ClientData * resolveInfos,
  30. Tcl_Var *varPtrPtr)
  31. {
  32. /* foreach ClientData in resolveInfos fill in a varPtr
  33. * (or NULL if not wanted) into varPtrPtr array, which is the variable
  34. * the varPtr of CompiledVars should be linked to
  35. */
  36.  
  37. retrun TCL_OK;
  38. }
  39.  
  40. What is your opinion to such an api?