The Tracer

The Tracer causes selected functions to be traced. When such a traced function is invoked, it prints

level > (name arg1 ... argn)

On return from a traced function, it prints

< level (name value1 ... valuen)

name is the name of the traced function, args are the arguments, and values are the return values. level is a number which is incremented each time a traced function is invoked and is decremented at the completion of the invocation. Trace print-outs are indented according to the level.


In the current version of KCL, macros and special forms cannot be traced.



trace {function-name}*[Macro]

Causes one or more functions to be traced. function-names must be symbols and they are not evaluated. If a function is called from a compiled function, the call may not produce trace print-outs. If this is the case, the simplest way to get trace print-outs is to recompile the caller with a notinline declaration for the called function (see Chapter 7). trace returns a name list of those functions that were traced by the call to trace . If no function-name is given, trace simply returns a name list of all the currently traced functions.

untrace {function-name}*[Macro]

Causes the specified functions to be not traced any more. function-names must be symbols and they are not evaluated. untrace returns a name list of those functions that were untraced by the call to untrace. If no function-name is given, untrace will untrace all the currently traced functions and will return a list of their names.