Structure of The Language
The basic data structure of Forth is the "dictionary" which maps "words" to executable code or named data structures. The dictionary is laid out in memory as a tree of linked lists with the links proceeding from the latest (most recently) defined word to the oldest, until a sentinel value, usually a NULL pointer, is found. A context switch causes a list search to start at a different leaf. A linked list search continues as the branch merges into the main trunk leading eventually back to the sentinel, the root. There can be several dictionaries. In rare cases such as meta-compilation a dictionary might be isolated and stand-alone. The effect resembles that of nesting namespaces and can overload keywords depending on the context.
A defined word generally consists of head and body with the head consisting of the name field (NF) and the link field (LF) and body consisting of the code field (CF) and the parameter field (PF).
Head and body of a dictionary entry are treated separately because they may not be contiguous. For example, when a Forth program is recompiled for a new platform, the head may remain on the compiling computer, while the body goes to the new platform. In some environments (such as embedded systems) the heads occupy memory unnecessarily. However, some cross-compilers may put heads in the target if the target itself is expected to support an interactive Forth.
Read more about this topic: Forth (programming Language)
Famous quotes containing the words structure of the, structure of, structure and/or language:
“Women over fifty already form one of the largest groups in the population structure of the western world. As long as they like themselves, they will not be an oppressed minority. In order to like themselves they must reject trivialization by others of who and what they are. A grown woman should not have to masquerade as a girl in order to remain in the land of the living.”
—Germaine Greer (b. 1939)
“... the structure of our public morality crashed to earth. Above its grave a tombstone read, Be toleranteven of evil. Logically the next step would be to say to our commonwealths criminals, I disagree that its all right to rob and murder, but naturally I respect your opinion. Tolerance is only complacence when it makes no distinction between right and wrong.”
—Sarah Patton Boyle, U.S. civil rights activist and author. The Desegregated Heart, part 2, ch. 2 (1962)
“When a house is tottering to its fall,
The strain lies heaviest on the weakest part,
One tiny crack throughout the structure spreads,
And its own weight soon brings it toppling down.”
—Ovid (Publius Ovidius Naso)
“Syntax and vocabulary are overwhelming constraintsthe rules that run us. Language is using us to talkwe think were using the language, but language is doing the thinking, were its slavish agents.”
—Harry Mathews (b. 1930)