- (trace <procedure>) works for any expression whose value is a
procedure. See also trace-entry and trace-exit.
- Shows when a procedure is called, the arguments to it, and the value it returns.
- Remove via untrace (or untrace-entry or untrace-exit). Untrace all
procedures using (untrace), etc.
- Warning: exit tracing "breaks tail recursion" and turns iterative
processes into recursive ones, so you may run out of memory.
- It is possible to trace a procedure that is defined within another procedure: (trace
fact '(iter)) would trace the procedure iter that is nested inside the
procedure fact. It isn't possible to trace procedures created using letrec
or internal lambda expressions; only nested procedures given a name through define.