|
|
|
參閱(See):
A.16 選用的搜尋順序詞集(The optional Search-Order word set)
參閱(See):
A.16.2 附加的專有名詞(Additional terms)
Word list identifiers are implementation-dependent single-cell values that identify word lists.
將表格 16.1 加進 表格 3.1.
Append table 16.1 to table 3.1.
表格 16.1 - 資料型別
符號 資料型別 在堆疊上的大小 ------ --------- ------------- wid 詞列表識別記號 1 cell
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 Forth 文字解譯器(The Forth text interpreter).
Append table 16.2 to table 3.5.
參閱(See):
3.2.6 環境的詢問(Environmental queries)
表格 16.2 - 環境詢問字串
字串 值 資料型別 常數? 意義 ------ --------------- --------- ------- SEARCH-ORDER flag no 搜尋順序詞集存在 SEARCH-ORDER-EXT flag no 搜尋順序延伸詞集存在 WORDLISTS n yes 在搜尋順序中最大的可用詞列表數量
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
When searching a word list for a definition name, the system shall search each word list from its last definition to its first. The search may encompass only a single word list, as with SEARCH-WORDLIST, or all the word lists in the search order, as with the text interpreter and FIND.
改變搜尋順序必須只影響隨後在詞典中定義名稱的找尋.
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.
如果一個程式在編譯一個定義時或是在用 ;CODE, DOES>, 或 IMMEDIATE 修改最近編譯的定義的表現之前, 改變了編譯詞列表, 將會有一個模稜兩可的情況存在.
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 regions of data space produced by the operations described in 3.3.3.2 Contiguous regions may be non-contiguous if WORDLIST is executed between allocations.
The phrase Providing the Search-Order word set shall be appended to the label of any Standard System that provides all of the Search-Order word set.
措辭 從搜尋順序延伸詞集提供 name(s) 必須被加到任何提供部分搜尋順序延伸詞集的標準系統的描述之中.
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 the Search-Order word set shall be appended to the label of Standard Programs that require the system to provide the Search-Order word set.
措辭 需要搜尋順序延伸詞集中的 name(s) 必須被加到任何需要系統提供部分搜尋順序延伸詞集的標準程式的描述之中.
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
( -- )
讓編譯詞列表跟在搜尋順序中的第一個詞列表相同. 指定接著定義的名稱將會被放在編譯詞列表中. 接著的在搜尋順序中的改變將不會影響編譯詞列表.
參閱:
16.3.3 找出定義名稱
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
延伸 6.1.1550 FIND 的語義成為:
( c-addr -- c-addr 0 | xt 1 | xt -1 )
找出在 c-addr 的計數字串中的定義名稱. 如果在搜尋了在所有的搜尋順序中的詞列表之後找不到這個定義, 回傳 c-addr 和零. 如果找到了這個定義, 回傳 xt. 如果這個定義是立即的, 也回傳一(1); 否則也回傳負一(-1). 對於一個給定的字串, 這個由 FIND 傳回的值可以在編譯時與非編譯時傳回不同的值.
參閱:
3.4.2 找出定義名稱,
6.1.0070 ' ,
6.1.2033 POSTPONE ,
6.1.2510 ['] ,
D.6.7 立即性.
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 )
傳回 wid, 詞列表的識別代號, 它包含了所有的由這個實作提供的標準詞. 這個詞列表是最初的編譯詞列表, 並且是最初的搜尋順序的一部分.
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 )
傳回 wid, 這個編譯詞列表的識別代號.
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 )
傳回在搜尋順序中的詞列表的數目 n, 和這些識別詞列表的識別代號 widn .. wid. wid1 識別了被首先搜尋的詞列表, 而 widn 識別了最後搜尋的詞列表. 這個搜尋順序不受影響.
參閱:
RFI 0002
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 )
找出在由 wid 識別的詞列表中由字串 c-addr u 識別的定義. 如果找不到這個定義, 回傳零. 如果找到了這個定義, 回傳它的執行代碼 xt 和一 (1) (如果這個定義是立即的), 否則傳回負一 (-1).
參閱:
A.16.6.1.2192 SEARCH-WORDLIST
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 -- )
設定編譯詞列表到由 wid 識別的詞列表.
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 -- )
設定搜尋順序成由 widn ... wid1 識別的詞列表. 隨後, 詞列表 wid1 將會是第一個被搜尋的, 而詞列表 widn 是最後被搜尋的. 如果 n 是零, 清空搜尋順序. 如果 n 是負一, 設定搜尋順序成實作自訂的最小搜尋順序. 這個最小的搜尋順序必須包含詞 FORTH-WORDLIST 和 SET-ORDER. 一個系統必須允許 n 至少八.
參閱:
RFI 0002
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 )
創造一個新的空白的詞列表, 傳回它的詞列表識別代號 wid. 這個新的詞列表可以從一個預先配置的詞列表池中傳回, 或可以動態地在資料空間中配置. 一個系統必須允許創造至少八個新的詞列表附加於任何像是系統提供的部分一樣.
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
( -- )
改變由 widn, ... wid2, wid1 (這裡的 wid1 最先被搜尋) 組成的搜尋順序成 widn, ... wid2, wid1, wid1. 如果有太多的詞列表在搜尋順序中時, 將會有模稜兩可的情況存在.
參閱:
A.16.6.2.0715 ALSO ,
RFI 0002
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
( -- )
改變由 widn, ... wid2, wid1 (這裡的 wid1 最先被搜尋) 組成的搜尋順序成 widn, ... wid2, wid FORTH-WORDLIST.
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
( -- )
設定搜尋順序成實作自訂的最小搜尋順序. 這個最小的搜尋順序必須包含詞 FORTH-WORDLIST 和 SET-ORDER.
參閱:
RFI 0002
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
( -- )
顯示在搜尋順序中的詞列表, 以它們的搜尋順序序列, 從第一個被搜尋到最後一個被搜尋. 也顯示新的定義將被放置於哪一個詞列表. 這個顯示的格式是實作相依的.
ORDER 可以使用書寫數字輸出詞實作. 因此, 它的使用可能破壞由 #> 識別的暫時的區域.
參閱:
3.3.3.6 其他暫時的區域
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
( -- )
改變由 widn, ... wid2, wid1 (這裡的 wid1 最先被搜尋) 組成的搜尋順序成 widn, ... wid2. 如果在執行 PREVIOUS 之前搜尋順序是空的時, 將會有模稜兩可的情況存在.
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.
內容列表(Table of Contents)
下一章(Next Section)