Table of Contents |
See:
A.16 The optional Search-Order word set
See:
A.16.2 Additional terms
Append table 16.1 to table 3.1.
Table 16.1 - Data types
Symbol Data type Size on stack ------ --------- ------------- wid word list identifiers 1 cell
See:
3.1 Data types,
3.4.2 Finding definition names,
3.4 The Forth text interpreter.
See:
3.2.6 Environmental queries
Table 16.2 - Environmental query strings
String Value data type Constant? Meaning ------ --------------- --------- ------- SEARCH-ORDER flag no search-order word set present SEARCH-ORDER-EXT flag no search-order extensions word set present WORDLISTS n yes maximum number of word lists usable in the search order
Changing the search order shall only affect the subsequent finding of definition names in the dictionary.
A system with the Search-Order word set shall allow at least eight word lists in the search order.
An ambiguous condition exists if a program changes the compilation word list during the compilation of a definition or before modification of the behavior of the most recently compiled definition with ;CODE, DOES>, or IMMEDIATE.
A program that requires more than eight word lists in the search order has an environmental dependency.
See:
3.4.2 Finding definition names,
A.16.3.3 Finding definition names.
The phrase Providing name(s) from the Search-Order Extensions word set shall be appended to the label of any Standard System that provides portions of the Search-Order Extensions word set.
The phrase Providing the Search-Order Extensions word set shall be appended to the label of any Standard System that provides all of the Search-Order and Search-Order Extensions word sets.
The phrase Requiring name(s) from the Search-Order Extensions word set shall be appended to the label of Standard Programs that require the system to provide portions of the Search-Order Extensions word set.
The phrase Requiring the Search-Order Extensions word set shall be appended to the label of Standard Programs that require the system to provide all of the Search-Order and Search-Order Extensions word sets.
16.6.1.1180 DEFINITIONS
( -- )
Make the compilation word list the same as the first word list in the search order. Specifies that the names of subsequent definitions will be placed in the compilation word list. Subsequent changes in the search order will not affect the compilation word list.
See:
16.3.3 Finding Definition Names
16.6.1.1550 FIND
Extend the semantics of 6.1.1550 FIND to be:
( c-addr -- c-addr 0 | xt 1 | xt -1 )
Find the definition named in the counted string at c-addr. If the definition is not found after searching all the word lists in the search order, return c-addr and zero. If the definition is found, return xt. If the definition is immediate, also return one (1); otherwise also return minus-one (-1). For a given string, the values returned by FIND while compiling may differ from those returned while not compiling.
See:
3.4.2 Finding definition names,
6.1.0070 ' ,
6.1.2033 POSTPONE ,
6.1.2510 ['] ,
D.6.7 Immediacy.
16.6.1.1595 FORTH-WORDLIST
( -- wid )
Return wid, the identifier of the word list that includes all standard words provided by the implementation. This word list is initially the compilation word list and is part of the initial search order.
16.6.1.1643 GET-CURRENT
( -- wid )
Return wid, the identifier of the compilation word list.
16.6.1.1647 GET-ORDER
( -- widn ... wid1 n )
Returns the number of word lists n in the search order and the word list identifiers widn ... wid1 identifying these word lists. wid1 identifies the word list that is searched first, and widn the word list that is searched last. The search order is unaffected.
See:
RFI 0002
16.6.1.2192 SEARCH-WORDLIST
( c-addr u wid -- 0 | xt 1 | xt -1 )
Find the definition identified by the string c-addr u in the word list identified by wid. If the definition is not found, return zero. If the definition is found, return its execution token xt and one (1) if the definition is immediate, minus-one (-1) otherwise.
See:
A.16.6.1.2192 SEARCH-WORDLIST
16.6.1.2195 SET-CURRENT
( wid -- )
Set the compilation word list to the word list identified by wid.
16.6.1.2197 SET-ORDER
( widn ... wid1 n -- )
Set the search order to the word lists identified by widn ... wid1. Subsequently, word list wid1 will be searched first, and word list widn searched last. If n is zero, empty the search order. If n is minus one, set the search order to the implementation-defined minimum search order. The minimum search order shall include the words FORTH-WORDLIST and SET-ORDER. A system shall allow n to be at least eight.
See:
RFI 0002
16.6.1.2460 WORDLIST
( -- wid )
Create a new empty word list, returning its word list identifier wid. The new word list may be returned from a pool of preallocated word lists or may be dynamically allocated in data space. A system shall allow the creation of at least 8 new word lists in addition to any provided as part of the system.
16.6.2.0715 ALSO
( -- )
Transform the search order consisting of widn, ... wid2, wid1 (where wid1 is searched first) into widn, ... wid2, wid1, wid1. An ambiguous condition exists if there are too many word lists in the search order.
See:
A.16.6.2.0715 ALSO ,
RFI 0002
16.6.2.1590 FORTH
( -- )
Transform the search order consisting of widn, ... wid2, wid1 (where wid1 is searched first) into widn, ... wid2, wid FORTH-WORDLIST.
16.6.2.1965 ONLY
( -- )
Set the search order to the implementation-defined minimum search order. The minimum search order shall include the words FORTH-WORDLIST and SET-ORDER.
See:
RFI 0002
16.6.2.1985 ORDER
( -- )
Display the word lists in the search order in their search order sequence, from first searched to last searched. Also display the word list into which new definitions will be placed. The display format is implementation dependent.
ORDER may be implemented using pictured numeric output words. Consequently, its use may corrupt the transient region identified by #>.
See:
3.3.3.6 Other Transient Regions
16.6.2.2037 PREVIOUS
( -- )
Transform the search order consisting of widn, ... wid2, wid1 (where wid1 is searched first) into widn, ... wid2. An ambiguous condition exists if the search order was empty before PREVIOUS was executed.