:before list of forms
, the list of forms is evaluated on entry to the function being traced. The forms are evaluated and the results printed after the arguments to the function.
Here is an example of its use.
is bound to the list of arguments given to the function being traced. In this example, it is used to accumulate a list of all the arguments to
across all iterations.
(setq args-in-reverse ())
facfunction used earlier, set the value of
:beforeto the following list:
((push (car *traced-arglist*) args-in-reverse))
After evaluating this form,
has the value
(1 2 3)
, that is, it lists the arguments which
was called with, in the reverse order they were called in.
:after list of forms
, this option evaluates a list of forms upon return from the function to be traced. The forms are evaluated and the results printed after the results of a call to the function.
This option is used in exactly the same way as
. For instance, using the example for
as a basis, create a list called
, and set the value of
is pushed onto this list. After calling
contains the results returned from
, in the reverse order they were called in.
is still bound as well.