15.5 StatementsEvery statement is an expression, optionally followed by a modifier, and terminated with a semicolon. The semicolon may be omitted if the statement is the final one in a block. Execution of expressions can depend on other expressions using one of the modifiers if, unless, while, or until, for example:
expr1 if expr2 ; expr1 until expr2 ; The logical operators ||, &&, or ?: also allow conditional execution:
expr1 || expr2 ; expr1 ? expr2 : expr3 ; Statements can be combined to form a block when enclosed in {}. blocks may be used to control flow:
Program flow can be controlled with:
Special forms are:
do block while expr ; do block until expr ; which are guaranteed to perform block once before testing expr, and
do block which effectively turns block into an expression. |
|