Content deleted Content added
→Structure of the compiler: format code as code |
→Structure of the compiler: forbid line breaks in FORTH words |
||
Line 145:
The "compile time" flag in the name field is set for words with "compile time" behavior. Most simple words execute the same code whether they are typed on a command line, or embedded in code. When compiling these, the compiler simply places code or a threaded pointer to the word.<ref name="compiler" />
The classic examples of compile-time words are the [[control structure]]s such as <code>IF</code> and <code>WHILE</code>. Almost all of Forth's control structures and almost all of its compiler are implemented as compile-time words. Apart from some rarely used [[control flow]] words only found in a few implementations, such as the conditional return word
<syntaxhighlight lang="forth">
... DUP 6 < IF DROP 5 ELSE 1 - THEN ...
|