while for core

Conditionally run a block in a loop.

Signature

> while {flags} (cond) (block)

Parameters

  • cond: Condition to check.
  • block: Block to loop if check succeeds.

Input/output types:

inputoutput
nothingnothing

Examples

Loop while a condition is true

> mut x = 0; while $x < 10 { $x = $x + 1 }