The trap context is an object that caches information about the
low level trap call and the stack at the point of the trap, and is
passed as the only argument to all behaviour procedures. The
information in the trap context can be accessed through the procedures
tc: that are exported by the
traps) module1; the
most useful of these are as follows.
Indicates the type of the low level trap by returning one of the keywords
#:return, this provides the value that is being returned.
Provides the stack at the point of the trap (as computed by
make-stack, but cached so that the lengthy
make-stackoperation is not performed more than once for the same low level trap).
The innermost frame of the stack at the point of the trap.
The number of frames (including tail recursive non-real frames) in the stack at the point of the trap.
The number of real frames (that is, excluding the non-real frames that describe tail recursive calls) in the stack at the point of the trap.