home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
forth
/
compiler
/
love
/
chap08.doc
< prev
next >
Wrap
Text File
|
1993-04-11
|
2KB
|
56 lines
Chapter8 L_O_V_E FORTH
8.0 Vocabularies in L.O.V.E. Forth
------------------------------
L.O.V.E. Forth implements the Forth-83 standard vocabularies with
some of the words in the experimental proposal by William F. Ragsdale.
The specification for vocabularies in the Forth-83 standard leaves much to
be desired by expert and novice programmers alike. Ragsdale's proposal
solves many of the problems with a simple and powerfull concept. His ideas
have been so widely implemented, that they can be considered an integral
and crucial part of the Forth-83 standard.
L.O.V.E. Forth implements the concept of a 'search order' by means
of a special stack, the vocabulary stack, which contains the parameter
field addresses of vocabularies, that are to be searched when interpreting
or compiling. The search order may be inspected at any time by typing the
word ORDER.
Example:
ORDER <cr>
Displays:
Search Order: -> TOOLBOX FORTH ROOT
Definitions: FORTH
The vocabularies are currently being searched by first searching
TOOLBOX then FORTH and finally ROOT . All new DEFINITIONS that
are compiled are currently being put into the FORTH vocabulary.
The ROOT vocabulary is always the last vocabulary in the search
order, and contains the Forth words to alter the search order, to create
new vocabularies, to list the words in a vocabulary and to FORGET words
from the dictionary.
8.1 Specifying a Search Order
-------------------------
The search order can changed at any time by executing a combination
of the words ONLY and ALSO with vocabulary names.
Example:
To compile a word into the MSDOS vocabulary, while also making use of
some MSDOS file functions...
ONLY FORTH ALSO MSDOS DEFINITIONS
makes the search order:
Search Order: -> MSDOS FORTH ROOT
Definitions: MSDOS