Re: TraceScan
- To: mathgroup at smc.vnet.net
- Subject: [mg63713] Re: TraceScan
- From: dh <dh at metrohm.ch>
- Date: Tue, 10 Jan 2006 04:50:39 -0500 (EST)
- References: <dpvmlr$lua$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Chris,
I think TraceScan[f,expr] applies the function f to all parts of expr.
If f is not producing any output, you see nothing. Therefore,
TraceScan[Print,expr]
would produce the same output as TracePrint.
Daniel
Chris Rodgers wrote:
> Hi,
>
> I can't seem to get TraceScan to work. Can someone explain why this
> TraceScan command produces only a single line of output (with no
> intermediate steps in evaluation) whereas the later Trace and TracePrint
> examples show several steps?
>
> Doesn't seem to work:
>
> In[94]:=
> TraceScan[InputForm,f[x+y+2+3]]
>
> Out[94]=
> f[5+x+y]
>
> Produces intermediate steps:
>
> In[95]:=
> Trace[f[x+y+2+3]]
>
> Out[95]=
> {{x+y+2+3,5+x+y},f[5+x+y]}
>
> So does this:
>
> In[96]:=
> TracePrint[f[x+y+2+3]]
>
> From In[96]:=
> \[InvisibleSpace]f[x+y+2+3]
>
> From In[96]:=
> \[InvisibleSpace]f
>
> From In[96]:=
> \[InvisibleSpace]x+y+2+3
>
> From In[96]:=
> \[InvisibleSpace]Plus
>
> From In[96]:=
> \[InvisibleSpace]x
>
> From In[96]:=
> \[InvisibleSpace]y
>
> From In[96]:=
> \[InvisibleSpace]2
>
> From In[96]:=
> \[InvisibleSpace]3
>
> From In[96]:=
> \[InvisibleSpace]5+x+y
>
> From In[96]:=
> \[InvisibleSpace]Plus
>
> From In[96]:=
> \[InvisibleSpace]5
>
> From In[96]:=
> \[InvisibleSpace]x
>
> From In[96]:=
> \[InvisibleSpace]y
>
> From In[96]:=
> \[InvisibleSpace]f[5+x+y]
>
> Out[96]=
> f[5+x+y]
>
> Many thanks,
>
> Chris.
>