version 1.204, 2009/04/22 10:38:30
|
version 1.205, 2009/10/31 21:30:01
|
Line 1306 word
|
Line 1306 word
|
5!a |
5!a |
@end example |
@end example |
|
|
A frequent beginner's error is to leave away necessary white space, |
A frequent beginner's error is to leave out necessary white space, |
resulting in an error like @samp{Undefined word}; so if you see such an |
resulting in an error like @samp{Undefined word}; so if you see such an |
error, check if you have put spaces wherever necessary. |
error, check if you have put spaces wherever necessary. |
|
|
Line 1347 them), let's learn how to produce meanin
|
Line 1347 them), let's learn how to produce meanin
|
@cindex stack tutorial |
@cindex stack tutorial |
|
|
The most obvious feature of Forth is the stack. When you type in a |
The most obvious feature of Forth is the stack. When you type in a |
number, it is pushed on the stack. You can display the content of the |
number, it is pushed on the stack. You can display the contents of the |
stack with @code{.s}. |
stack with @code{.s}. |
|
|
@example |
@example |
Line 1358 stack with @code{.s}.
|
Line 1358 stack with @code{.s}.
|
@code{.s} displays the top-of-stack to the right, i.e., the numbers |
@code{.s} displays the top-of-stack to the right, i.e., the numbers |
appear in @code{.s} output as they appeared in the input. |
appear in @code{.s} output as they appeared in the input. |
|
|
You can print the top of stack element with @code{.}. |
You can print the top element of the stack with @code{.}. |
|
|
@example |
@example |
1 2 3 . . . |
1 2 3 . . . |