Next: , Previous: Procedure Traps, Up: Traps


5.21.3.11 Exit Traps

The <exit-trap> class implements traps that are triggered upon stack frame exit past a specified stack depth. Instances of this class should use the #:depth option to specify the target stack depth.

— Class: <exit-trap>

Class for traps triggered by exit past a specified stack depth.

— Trap Option: #:depth depth

Specifies the reference depth for the trap.

Example:

     (define (trace-at-exit trap-context)
       (install-trap (make <exit-trap>
     		  #:depth (tc:depth trap-context)
     		  #:single-shot #t
     		  #:behaviour trace-trap)))

(This is the actual definition of the trace-at-exit behaviour.)