.BG
.FN trace
.FN untrace
.TL
Trace Calls to Functions
.CS
trace(what, tracer = std.trace)
untrace(what)
.AG what
character vector, giving the names of functions: `trace'
adds the functions to the list of those whose calls are traced and `untrace'
removes them from that list.
There is no effect on the functions themselves.
.AG tracer
the name of a function, to do the tracing on `fun'.
If omitted, a standard tracing function is used,
which prints a line
giving the function call itself before `fun'
is called, and another giving the value of the call just before
returning.
See `trace.on' for other alternatives.
.SE
The effect of putting a function, `fun', on the trace list
to be traced by the function `tracer'
is exactly as if every call to `fun'
were embedded in a call to `tracer';
i.e., `fun(...)'
becomes `tracer(fun(...))'.
.EX
trace("parse") # record all calls to the parser
.KW programming
.WR
