While

While loops allow a block of code to be repeated to long as the loop's boolean condition evaluates to true.

Upon entering a loop, any existing linear resources become guarded and, within loops, all non-guarded linear resources must be used. This ensures the type safe use of linear resources despite the loop's repitition. More details are forthcoming; however, the original Bismuth paper may be useful.

Syntax

While loops follows the following syntax:

while(e : boolean) { // Note, parenthesis around contion are optional
  // Loop body code
}

For example, a while loop that repeats 10 times could be written as:

int i := 0; 

while i < 10 {
  i := i + 1; 
}