4.2 The Tracer

4.2.1 Using the Tracer

The Tracer is invoked by calling the macrotrace on one or more functions. Tracing information is normally printed whenever the traced function is entered or exited. Tracing information consists of the name of the function followed at entry by its arguments and on exit by its return values. For example, the following code traces a call to the functioncdr:

> (trace cdr)
(CDR)

> (cdr '(1 2 3)) 1 Enter CDR (1 2 3) 1 Exit CDR (2 3) (2 3)

If a function is already being traced,trace calls the macrountrace before starting the new trace. Callingtrace with no arguments returns a list of all functions that are currently being traced.

Callinguntrace restores functions to their normal state. You can call this macro with one or more function names as arguments. Calling it with no arguments untraces all the functions currently being traced.

Forms are evaluated in the lexical environment at the time of the call totrace. Special forms cannot be traced because they are neither functions nor macros. Callingtrace on a macro traces the macro expansion, not the evaluation of the form.


The User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker