type: special form (fsubr) location: built-in source file: xlcont.c Common LISP compatible: similar supported on: all machines
(trace <function> ... ) <function> - an unquoted function
The TRACE special form allows the tracing of user or system functions. TRACE returns a list containing the current set of functions that are being traced. The <function> does not have to be currently defined, it can be created as part of the execution. The trace output consists of entry and exit information. At entry and exit of a traced <function>, lines will be printed of the form:
Entering: <function>, Argument list: <arg-list> . . . Exiting: <function>, Value: <ret-value>
(defun foo (x) (print (car x))) ; define FOO (trace 'foo) ; returns (FOO) (trace 'car) ; returns (CAR FOO) (foo '(a)) ; Entering: FOO, Argument list: ((A)) ; Entering: CAR, Argument list: ((A)) ; Exiting: CAR, Value: A ; A ; Exiting: FOO, Value: A ; returns A
COMMON LISP COMPATIBILITY: The XLISP TRACE function does not support any keyword options, which Common LISP allows.