File r37/lisp/csl/html/r37_0223.html artifact 1a2d23ccdd part of check-in 3c4d7b69af



<A NAME=TR>

<TITLE>TR</TITLE></A>
<b><a href=r37_idx.html>INDEX</a></b><p><p>



<B>TR</B> _ _ _  _ _ _  _ _ _  _ _ _ <B>declaration</B><P>
<P>
 
 <P>
<P>
The <em>tr</em> declaration is used to trace system or user-written procedures. 

It is only useful to those with a good knowledge of both Lisp and the 
internal formats used by REDUCE. 
<P>
<P>
 <P> <H3> 
syntax: </H3>
<em>tr</em>&lt;name&gt;{,&lt;name&gt;}* 
<P>
<P>
<P>
&lt;name&gt; is the name of a REDUCE system procedure or one of your own 
procedures. 
<P>
<P>
 <P> <H3> 
examples: </H3>
<P><PRE><TT></TT></PRE><P>The system procedure <em>prepsq</em> is traced, 
 which prepares REDUCE standard 
forms for printing by converting them to a Lisp prefix form.<P><PRE><TT> 

tr prepsq; 

  (PREPSQ) 


x**2 + y; 

  PREPSQ entry:
    Arg 1: (((((X . 2) . 1) ((Y . 1) . 1)) . 1)
  PREPSQ return value = (PLUS (EXPT X 2) Y)
  PREPSQ entry:
    Arg 1: (1 . 1)
  PREPSQ return value = 1
   2
  X  + Y


untr prepsq; 

  (PREPSQ)

</TT></PRE><P> 
<P>
<P>
This example is for a PSL-based system; the above format will vary if 
other Lisp systems are used. 
<P>
<P>
When a procedure is traced, the first lines show entry to the procedure and 
the arguments it is given. The value returned by the procedure is printed 
upon exit. If you are tracing several procedures, with a call to one of 
them inside the other, the inner trace will be indented showing procedure 
nesting. There are no trace options. However, the format of the trace 
depends on the underlying Lisp system used. The trace can be removed with 
the command 
<A HREF=r37_0224.html>untr</A>. Note that <em>trace</em>, below, is a matrix 
operator, while <em>tr</em> does procedure tracing. 
<P>
<P>
<P>


REDUCE Historical
REDUCE Sourceforge Project | Historical SVN Repository | GitHub Mirror | SourceHut Mirror | NotABug Mirror | Chisel Mirror | Chisel RSS ]