until
An until
executes its body until its condition is truthy. An until
is just syntax sugar for a while
with the condition negated:
until some_condition
do_this
end
# The above is the same as:
while !some_condition
do_this
end
break
and next
can also be used inside an until
, and like in while
expressions, break
s may be used to return values from an until
.
To the extent possible under law, the persons who contributed to this workhave waived
all copyright and related or neighboring rights to this workby associating CC0 with it.
https://crystal-lang.org/reference/syntax_and_semantics/until.html