|
|
@@ -1,9 +1,9 @@ |
|
|
|
Flow |
|
|
|
|
|
|
|
Note about flow words: 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. |
|
|
|
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. |
|
|
|
|
|
|
|
f IF A ELSE B THEN: if f is true, execute A, if false, execute |
|
|
|
B. ELSE is optional. |
|
|
@@ -11,6 +11,6 @@ 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. |
|
|
|
x CASE y OF A ENDOF z OF B ENDOF C ENDCASE: If x == y, execute |
|
|
|
A, if x == z, execute B. Otherwise, execute C. |
|
|
|
|
|
|
|
(cont.) |
|
|
|
A, if x == z, execute B. Otherwise, execute C. x is dropped |
|
|
|
in case of an OF match, *but it is kept if it reaches C*. You |
|
|
|
have to consume it to avoid PSP leak. (cont.) |