Control in Sequential Languages
After looking briefly at the history of jumps and structured control, we will study exceptions and continuations. Exceptions are a form of jump that exits a block or function call, returning to some previously established point for handling the exception. Continuations are a more general form of “return” based on calling a function that is passed into a block for this purpose. The chapter concludes with a discussion of force and delay, complimentary techniques for delaying computation by placing it inside a function and forcing delayed computation with a function call.
8.1 STRUCTURED CONTROL
8.1.1 Spaghetti Code
In Fortran or assembly code, it is easy to write programs with incomprehensible control structure. ...