Control Functions.while

Executes a loop with a pre-condition.

Arguments

conditionBody
is a callable to evaluate the loop pre-condition. The condition will be checked before each iteration. The loop will continue if and only if the condition evaluates to TRUE. It has the following stack notation:
( -- condition )
loopBody
is the callable to execute.

Return values

None

Example

"sl/control" useFile
i: 0;
[i 5 < ] [
i print
i 1 + !i
] while
Try it

Output:
01234