At a script level, I believe the following three cases are necessary to exercise all code paths. Using lappend as an example
1. Compiled with a local variable table (or use apply instead of
defining a proc)
proc testlappend {} {
lappend L a b c
}
testlappend
2. Compiled without a local variable table
lappend L a b c
3. Uncompiled
set testcmd lappend
$testcmd L a b c
Corrections from Tcl bytecode gurus welcome
/Ashok
On 10/24/2023 12:57 AM, sam appleton wrote:
Hiya All,
We are facing some difficulties in the behavior of TCL between the "non-bytecode" execution vs bytecode execution,
for since
Tcl_LappendObjCmd
vs.
TclCompileLappendCmd
How does TCL determine whether it's going to "compile" input or just interpret it - and is there any way to "force" one way or the other (dynamically)
for testing purposes? For our testing, we need to force the two paths through the
interpreter for the same input to verify that the behavior is the same. For example, in some cases we see TCL take the "interpreted" path and call Tcl_LappendObjCmd, and in other cases, it bytecompiles the input and goes through the
TclCompileLappendCmd path.
Sam Appleton
Ausdia Inc.
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)