Next: Defining Words, Previous: Strings and Characters, Up: Words [Contents][Index]
Control structures in Forth cannot be used interpretively, only in a colon definition14. We do not like this limitation, but have not seen a satisfying way around it yet, although many schemes have been proposed.
• Selection | IF ... ELSE ... THEN | |
• General Loops | BEGIN ... | |
• Counted Loops | DO | |
• General loops with multiple exits | ||
• General control structures with CASE | ||
• Arbitrary control structures | ||
• Calls and returns | ||
• Exception Handling |
To be precise, in Standard Forth the control-flow words have no interpretation semantics, and in Gforth the interpetation semantics of the control-flow words are not useful for interpretive control flow (see Interpretation and Compilation Semantics).