Go to the first, previous, next, last section, table of contents.


Words for Including

include-file       i*x fid -- j*x         file       ``include-file''

interpret (process using the text interpreter) the contents of the file fid.

included       i*x addr u -- j*x         file       ``included''

include-file the file whose name is given by the string addr u.

include       ... "file" -- ...         gforth       ``include''

includes file

Usually you want to include a file only if it is not included already (by, say, another source file):

required       i*x addr u -- j*x         gforth       ``required''

include the file with the name given by addr u, if it is not included (or required) already. Currently this works by comparing the name of the file (with path) against the names of earlier included files.

require       ... "file" -- ...         gforth       ``require''

includes file only if it is not included already

needs       ... "name" -- ...         gforth       ``needs''

an alias for require; exists on other systems (e.g., Win32Forth).

I recommend that you write your source files such that interpreting them does not change the stack. This allows using these files with required and friends without complications. E.g.,

1 require foo.fs drop


Go to the first, previous, next, last section, table of contents.