TR INDEX

TR _ _ _ _ _ _ _ _ _ _ _ _ declaration

The tr 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.

syntax:

tr<name>{,<name>}*

<name> is the name of a REDUCE system procedure or one of your own procedures.

examples:

The system procedure prepsq is traced, which prepares REDUCE standard forms for printing by converting them to a Lisp prefix form.

 

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)

This example is for a PSL-based system; the above format will vary if other Lisp systems are used.

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 untr. Note that trace, below, is a matrix operator, while tr does procedure tracing.