loop for core

Run a block in a loop.

Signature

> loop {flags} (block)

Parameters

  • block: Block to loop.

Input/output types:

inputoutput
nothingnothing

Examples

Loop while a condition is true

> mut x = 0; loop { if $x > 10 { break }; $x = $x + 1 }; $x
11