until
Evaluates an expression at least once and then repeatedly as long as a condition is not met.
Syntax
-
until(expr, cond)
-
expr
is an expression -
cond
is an expression
-
Description
until(expr, cond)
evaluates expr
and then cond
. If cond
returns true
, until
returns. Otherwise, the process starts over with a new evaluation of expr
and then of cond
. This is repeated until cond
returns true
. until
always returns null
, so it is only used for its side effects.
Examples
until((A ≔ RandomIntMatrix(5, −5, 6)), IsSingular(A)); A
⎛ 5 −2 −1 4 −5⎞ ⎜−3 −3 3 2 3⎟ ⎜ 2 −5 5 4 −5⎟ ⎜−3 2 0 0 −2⎟ ⎝−2 5 −4 −1 −2⎠