[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.25.4.5 Trap States
When multiple traps are present in a system, we begin to have a bookkeeping problem. How are they named? How does one disable, enable, or delete them?
Guile’s answer to this is to keep an implicit per-thread trap state. The trap state object is not exposed to the user; rather, API that works on trap states fetches the current trap state from the dynamic environment.
Traps are identified by integers. A trap can be enabled, disabled, or removed, and can have an associated user-visible name.
These procedures have their own module:
(use-modules (system vm trap-state))
- Scheme Procedure: add-trap! trap name
Add a trap to the current trap state, associating the given name with it. Returns a fresh trap identifier (an integer).
Note that usually the more specific functions detailed in High-Level Traps are used in preference to this one.
- Scheme Procedure: list-traps
List the current set of traps, both enabled and disabled. Returns a list of integers.
- Scheme Procedure: trap-name idx
Returns the name associated with trap idx, or
#f
if there is no such trap.
[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on April 20, 2013 using texi2html 5.0.