1.1 --- a/docs/exceptions.txt Sat Jul 26 01:16:02 2008 +0200
1.2 +++ b/docs/exceptions.txt Sun Jul 27 02:00:31 2008 +0200
1.3 @@ -1,13 +1,15 @@
1.4 Exception Handling
1.5 ------------------
1.6
1.7 -Where exceptions may be raised, the following rules are applied:
1.8 +An exception handler stack is defined such that when a try...except or
1.9 +try...finally block is entered, a new handler is defined.
1.10
1.11 - 1. If exception labels exist, any raised exception causes a jump to the
1.12 - handler label.
1.13 +When an exception is raised, the program jumps to the most recently defined
1.14 +handler. Inside the handler, the stack entry for the handler will be removed.
1.15
1.16 - 2. If no exception labels exist, any raised exception causes the current
1.17 - function to be terminated with an exception condition.
1.18 +Depending on the nature of the handler and whether the exception is handled,
1.19 +the program may jump to the next most recent handler, and so on.
1.20
1.21 - 3. Where an invocation returns with an exception condition set, rules #1 and
1.22 - #2 are applied.
1.23 +If no handler is defined when an exception is raised or re-raised, the program
1.24 +should terminate. This might be done by having a "handler #0" which explicitly
1.25 +terminates the program.