Overview
| Artifact ID: | 3b386cbe87fe1c0f0467257bbbb92c6a5130da24427c7df58f08b524aef7b86f |
|---|---|
| Ticket: | 9bdd5788e370acc24ddc8a57e5291832aada8e6b
TCL 8.6.8 does not work with Tcl_SetCommandInfo on some commands |
| User & Date: | sebres on 2018-11-19 10:23:54 |
Changes
- closedate changed to: "2458441.93326924"
- closer changed to: "sebres"
- icomment:
Firstly the usage of Tcl_SetCommandInfo may be insufficient for the internal tcl commands (e. g. because they may be compiled, etc). With this routine you can alter the command/proc you've created at binary/script level. The usage for tcl-internal commands is not really expected. Secondly Tcl 8.6 has more compiled command as 8.5, additionally Tcl 8.6 gets yet another processor called NRE to provide stackless evaluation (see [https://wiki.tcl-lang.org/page/NRE|wiki::NRE] or [https://www.tcl.tk/man/tcl/TclLib/NRE.htm|NRE manual page]for details).<br/> Both compiled and NRE (if available) are preferred evaluations inside the script. Thus to create a proper wrapper for a tcl-internal commands you should:<br/> - either rename the original and create a proxy-wrapper command (that can call "renamed" command internally), or delete/replace the original if unwanted to invoke it from proxy;<br/> - or use internal structure-type "Command" (from tclInt.h) instead of "Tcl_CmdInfo" to overwrite ALL proc-handler. For example set of nreProc/compileProc to NULL will force Tcl to process command invocation using objProc method.<br/> If you just want to trace the execution, the Tcl_TraceCommand or Tcl_CreateTrace/Tcl_CreateObjTrace are better candidates for purposes like this. Also note that tracing of the interpreter as well as non-compiled execution will do slowing down the tcl scripts, so the performance degrades significantly.
- login: "sebres"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Invalid"
- status changed to: "Closed"