1 Exception Handling
2 ==================
3
4 Active Exceptions
5 =================
6
7 When an exception is raised, an exception instance is defined as the active
8 exception. This active exception remains in force until either a new exception
9 is raised in any handling of the exception, or upon exit of a handler where
10 the active exception has been caught (thus resetting the active exception).
11
12 Handlers
13 ========
14
15 An exception handler stack is defined such that when a try...except or
16 try...finally block is entered, a new handler is defined.
17
18 When an exception is raised, the program jumps to the most recently defined
19 handler. Inside the handler, the stack entry for the handler will be removed.
20
21 Depending on the nature of the handler and whether the exception is handled,
22 the program may jump to the next most recent handler, and so on.
23
24 If no handler is defined when an exception is raised or re-raised, the program
25 should terminate. This might be done by having a "handler #0" which explicitly
26 terminates the program.
27
28 Instructions
29 ------------
30
31 PushHandler(block) defines an active handler at the location indicated by the
32 given block.
33
34 PopHandler removes the active handler at or after the location indicated by
35 the previously given block.