| just @code{( -- )}. You should also add some descriptive comment to |
just @code{( -- )}. You should also add some descriptive comment to |
| more complicated words (I usually do this in the lines following |
more complicated words (I usually do this in the lines following |
| @code{:}). If you don't do this, your code becomes unreadable (because |
@code{:}). If you don't do this, your code becomes unreadable (because |
| you have to work through every definition before you can undertsand |
you have to work through every definition before you can understand |
| any). |
any). |
| |
|
| @assignment |
@assignment |
| function; and since there is only one result, you don't have to deal with |
function; and since there is only one result, you don't have to deal with |
| the order of results, either. |
the order of results, either. |
| |
|
| In Forth (and other stack-based languages, e.g., Postscript) the |
In Forth (and other stack-based languages, e.g., PostScript) the |
| parameter and result order of a definition is important and should be |
parameter and result order of a definition is important and should be |
| designed well. The general guideline is to design the stack effect such |
designed well. The general guideline is to design the stack effect such |
| that the word is simple to use in most cases, even if that complicates |
that the word is simple to use in most cases, even if that complicates |
| @item providing the String Extensions word set (another easy one) |
@item providing the String Extensions word set (another easy one) |
| @end itemize |
@end itemize |
| |
|
| |
Gforth has the following environmental restrictions: |
| |
|
| |
@cindex environmental restrictions |
| |
@itemize @bullet |
| |
@item |
| |
While processing the OS command line, if an exception is not caught, |
| |
Gforth exits with a non-zero exit code instyead of performing QUIT. |
| |
|
| |
@item |
| |
When an @code{throw} is performed after a @code{query}, Gforth does not |
| |
allways restore the input source specification in effect at the |
| |
corresponding catch. |
| |
|
| |
@end itemize |
| |
|
| |
|
| @cindex system documentation |
@cindex system documentation |
| In addition, ANS Forth systems are required to document certain |
In addition, ANS Forth systems are required to document certain |
| implementation choices. This chapter tries to meet these |
implementation choices. This chapter tries to meet these |
| @item conditions under which control characters match a space delimiter: |
@item conditions under which control characters match a space delimiter: |
| @cindex space delimiters |
@cindex space delimiters |
| @cindex control characters as delimiters |
@cindex control characters as delimiters |
| If @code{WORD} is called with the space character as a delimiter, all |
If @code{word} is called with the space character as a delimiter, all |
| white-space characters (as identified by the C macro @code{isspace()}) |
white-space characters (as identified by the C macro @code{isspace()}) |
| are delimiters. @code{PARSE}, on the other hand, treats space like other |
are delimiters. @code{Parse}, on the other hand, treats space like other |
| delimiters. @code{SWORD} treats space like @code{WORD}, but behaves |
delimiters. @code{Parse-word}, which is used by the outer |
| like @code{PARSE} otherwise. @code{Name}, which is used by the outer |
|
| interpreter (aka text interpreter) by default, treats all white-space |
interpreter (aka text interpreter) by default, treats all white-space |
| characters as delimiters. |
characters as delimiters. |
| |
|