DO.UNTILinstructionlist
conditionlist
Repeatedly evaluates the instructionlist
as long as the evaluated conditionlist
remains FALSE.
DO.UNTIL evaluates instructionlist
before evaluating conditionlist
, so instructionlist
is always run at least once.
The conditionlist
input must contain an expression that evalautes to either TRUE or FALSE.
The fact that the conditionlist
input is a list may be misleading, because it should contain exactly one expression.
It is only a list because the contents of a list are not evaluated by default.
Instead, they must be explicitly evaluated with RUN.
This allows Logo to reevaluate conditionlist
after each iteration, rather than only evaluating it once.
MAKE "i 0
DO.UNTIL [MAKE "i :i+1 PRINT :i] [:i>3]
1
2
3
4