The (ice-9 debug)
module provides a tracing facility
(see Tracing) that is roughly similar to that described here, but
there are important differences.
(ice-9 debug)
trace gives a nice pictorial view of changes
in stack depth, by using indentation like this:
[fact1 4] | [fact1 3] | | [fact1 2] | | | [fact1 1] | | | | [fact1 0] | | | | 1 | | | 1 | | 2 | 6 24
However its output can only show the information seen here,
which corresponds to (ice-9 debugging trace)
's
trace/info
procedure; it cannot be configured to show other
pieces of information about the trap context in the way that the
(ice-9 debugging trace)
implementation can.
(ice-9 debug)
trace only allows the tracing of procedure
applications and their return values, whereas the (ice-9 debugging
trace)
implementation allows any kind of trap to be traced.
It's interesting to note that (ice-9 debug)
's restriction here,
which might initially appear to be just a straightforward consequence
of its implementation, is also somewhat dictated by its pictorial
display. The use of indentation in the output relies on hooking into
the low level trap calls in such a way that the trapped application
entries and exits exactly balance each other. The ice-9
debugging trace
implementation allows traps to be installed such that
entry and exit traps don't necessarily balance, which means that, in
general, indentation diagrams like the one above don't work.
It isn't currently possible to use both (ice-9 debug)
trace and
(ice-9 debugging trace)
in the same Guile session, because
their settings of the low level trap options conflict with each other.