Next Previous Up Top Contents Index

4.2 Tracing options

4.2.5 Configuring function entry and exit information

:entrycond

Trace keyword

:entrycond form

This option controls the printing of information on entry to a traced function. form is evaluated upon entry to the function, and information is printed if and only if form evaluates tot. This allows you to turn off printing of function entry information by supplying a form ofnil, as in the example below.
:exitcond

Trace keyword

:exitcond form

This option controls the printing of information on exit from a traced function. form is evaluated upon exit from the function, and, like:entrycond, information is printed if and only if form evaluates tot. This allows you to turn off printing of function exit information by supplying a form ofnil.

An example of using:exitcond and:entrycond is shown below:

1. For thefac function, set the values of:entrycond and:exitcond as follows.
:entrycond						=> (evenp (car *traced-arglist*))
:exitcond						=> (oddp (car *traced-arglist*))

Information is only printed on entry tofac if the argument passed tofac is even. Conversely, information is only printed on exit fromfac if the argument passed tofac is odd.

2. Type the following call to fac in a listener:
CL-USER 12 > (fac 10)

The tracing information printed is as follows:

0 FAC > (10)
    2 FAC > (8)
        4 FAC > (6)
            6 FAC > (4)
                8 FAC > (2)
                  9 FAC < (1)
              7 FAC < (6)
          5 FAC < (120)
      3 FAC < (5040)
  1 FAC < (362880)


LispWorks User Guide - 14 Oct 1998

Next Previous Up Top Contents Index

Generated with Harlequin WebMaker