David Blaikie 2971e129ad Add TODO breadcrumb from `for` design to semantics proposal (#4271) пре 1 година
..
README.md 93e7a37493 Start updating control flow design (#544) пре 4 година
conditionals.md 4e9e43a109 some issues in readme-file, replacing orange with apple (#2656) пре 3 година
loops.md 2971e129ad Add TODO breadcrumb from `for` design to semantics proposal (#4271) пре 1 година
return.md 84ea453161 Add semicolon to description of `return var;` statement. (#3131) пре 2 година

README.md

Control flow

Overview

Blocks of statements are generally executed linearly. However, statements are the primary place where this flow of execution can be controlled.

Carbon's flow control statements are:

  • if and else provides conditional execution of statements.
  • Loops:
    • while executes the loop body for as long as the loop expression returns True.
    • for iterates over an object, such as elements in an array.
    • break exits loops.
    • continue goes to the next iteration of a loop.
  • return ends the flow of execution within a function, returning it to the caller.