2020-04-15 00:04:09 +10:00
|
|
|
Flow
|
|
|
|
|
2020-04-28 10:44:21 +10:00
|
|
|
Note that flow words can only be used in definitions. In the
|
|
|
|
INTERPRET loop, they don't have the desired effect because each
|
|
|
|
word from the input stream is executed immediately. In this
|
|
|
|
context, branching doesn't work.
|
2020-04-15 00:04:09 +10:00
|
|
|
|
2020-04-17 05:07:31 +10:00
|
|
|
f IF A ELSE B THEN: if f is true, execute A, if false, execute
|
|
|
|
B. ELSE is optional.
|
2020-04-28 22:28:59 +10:00
|
|
|
[IF] .. [THEN]: Meta-IF. Works outside definitions. No [ELSE].
|
2020-04-17 05:07:31 +10:00
|
|
|
BEGIN .. f UNTIL: if f is false, branch to BEGIN.
|
|
|
|
BEGIN .. AGAIN: Always branch to BEGIN.
|
|
|
|
x y DO .. LOOP: LOOP increments y. if y != x, branch to DO.
|
2020-04-28 22:28:59 +10:00
|
|
|
|
|
|
|
|
|
|
|
(cont.)
|