Re: A tcl command logger?

From: George Petasis (petasis_at_iit.demokritos.gr)
Date: 03/24/05


Date: Thu, 24 Mar 2005 23:06:55 +0200

No, I was wrong. 'if' does not call
'expr'. I just checked the sources :-)
I somehow got confused reading the output of the
command logger...
Sorry for the false alarm :-)

George

Don Porter wrote:
> Helmut Giese wrote:
>
>>>newer versions of Tcl allow you to set traces on command execution,
>>>and even fine-graining this whether you want to trace 'enter' or
>>>'leave'
>
>
> George Petasis wrote:
>
>>Thank you both for your answers. However, as it has to run to
>>tcl 8.4,
>
>
> Execution traces are in Tcl 8.4.
>
>
>>What was
>>surprising though was to find that the 'if' command calls
>>'expr' to make the evaluation.
>
>
> No, it doesn't.
>
>
>>I would have expected 'if' to call the C API that
>>'expr' uses directly.
>
>
> It does; why do you believe otherwise.
>
> More precisely, the expression evaluations are compiled into bytecode,
> which gets executed.
>
>
>>b) If anybody messes with 'expr', also 'if' (and possibly 'while',
>>'for', etc) will be affected. Is this something expected?
>
>
> "messes with 'expr'" how, exactly?
>