Buy GNU books!
|[ < ]||[ > ]||[ << ]||[ Up ]||[ >> ]||[Top]||[Contents]||[Index]||[ ? ]|
When you start up a Forth compiler, a large number of definitions already exist. In Forth, you develop a new application using bottom-up programming techniques to create new definitions that are defined in terms of existing definitions. As you create each definition you can test and debug it interactively.
If you have tried out the examples in this section, you will probably
have typed them in by hand; when you leave Gforth, your definitions will
be lost. You can avoid this by using a text editor to enter Forth source
code into a file, and then loading code from the file using
include (see section 5.16.1 Forth source files). A Forth source file is
processed by the text interpreter, just as though you had typed it in by
Gforth also supports the traditional Forth alternative to using text files for program entry (see section 5.17 Blocks).
In common with many, if not most, Forth compilers, most of Gforth is actually written in Forth. All of the `.fs' files in the installation directory(8) are Forth source files, which you can study to see examples of Forth programming.
Gforth maintains a history file that records every line that you type to the text interpreter. This file is preserved between sessions, and is used to provide a command-line recall facility. If you enter long definitions by hand, you can use a text editor to paste them out of the history file into a Forth source file for reuse at a later time (for more information see section 2.3 Command-line editing).
|webmaster donations bookstore||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|