
Execute code after every tcl command?
Is there a way to automatically execute some code after every tcl
command is executed? For instance, if I did an eval { ... }, I would
like some bit of c code to be called after every command in the eval.
Presently, I have all the commands I add return a function instead of
TCL_OK, and that function does something then returns TCL_OK.
Unfortunately, this only works if the user happens to be executing
code I write.
I don't necessarily need the code to be executed after every line, but
I do need it to be called fairly often.
I should think that if you created a second interpreter, stripped out
*every* command from it, and mutzed with its 'unknown' command to run a
command in the orig interpreter (with whatever you want to do on each
cmd), then resend the actual cmd in the stripped interp...
(of course, you have to figure a way to avoid having this mechanism
triggered again).
It's probably just as easy to hack into the tcl core and add this by hand.
(1 line of code?)
--
Thanks again,
"Life___ is complicated."