micropython

docs/exceptions.txt

109:88ffc0d1c657
2008-07-27 Paul Boddie Moved parts of the documentation into the docs directory. Rewrote the exceptions documentation. Introduced dynamic lambda objects since lambdas with defaults may employ a variation of default values, not a selection of one-time definitions. Made default parameter generation sensitive to the lambda case. Removed default parameters for lambdas from the image. Changed the known context in class invocations to instances of the new Undefined class (instead of Instance). Added a test of instance construction. Added a StoreContext instruction to support lambda objects. Make MakeObject an immediate instruction.
     1 Exception Handling
     2 ------------------
     3 
     4 An exception handler stack is defined such that when a try...except or
     5 try...finally block is entered, a new handler is defined.
     6 
     7 When an exception is raised, the program jumps to the most recently defined
     8 handler. Inside the handler, the stack entry for the handler will be removed.
     9 
    10 Depending on the nature of the handler and whether the exception is handled,
    11 the program may jump to the next most recent handler, and so on.
    12 
    13 If no handler is defined when an exception is raised or re-raised, the program
    14 should terminate. This might be done by having a "handler #0" which explicitly
    15 terminates the program.