4.2 The Tracer
trace
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)If a function is already being traced,> (cdr '(1 2 3)) 1 Enter CDR (1 2 3) 1 Exit CDR (2 3) (2 3)
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.
Generated with Harlequin WebMaker