Next: , Previous: , Up: Statements   [Contents][Index]


7.16 Jumps

Control flow in a piece of LUX code generally goes from one statement to the next, with various loop and branch statements offering repetition and choice, and with user-defined subroutines, functions, and blockroutines offering modular structure. Control flow is easy to follow in such modular programs.

Some programming languages allow unconditional, unrestricted jumps to arbitrarily distant statements. Programs that use such jumps are sometimes referred to as "spaghetti" programs, as it tends to be hard to analyze such a program and to know what it will do.

LUX does not offer unrestricted jumps, since one can cast any algorithm in a form without such jumps. However, LUX does offer a small number of restricted jump statements which can be useful to exit from loop statements and other modular structures.