This proposal has been moved into this section. Its former address was: /standard/search
This page is dedicated to discussing this specific proposal
UlrichHoffmann VOCABULARYProposal2019-09-18 12:32:53
version uh 2019-09-18
Add the following section to the Forth-200x standard in the optional Search-Order word set to the Search-Order extension word list.
Skip leading space delimiters. Parse name delimited by a space. Create a definition for name with the execution semantics defined below. Create a new empty word list wid and associate it with name.
name is referred to as a "vocabulary".
( -- )
Replace the first word list in the search order by the word list wid that is associated with the vocabulary. An ambiguous condition exists if there are no word lists in the search order.
See: 22.214.171.1240 WORDLIST 16.6.2.0715 ALSO 126.96.36.1998 PREVIOUS 188.8.131.525 GET-ORDER 184.108.40.2067 SET-ORDER
Rationale: VOCABULARY has been used in traditional Forth systems and it is available with consistent behaviour in many standard systems. So it seems worthwhile to standardize it (again, it has been standardized in Forth-83).
VOCABULARY Assembler ONLY FORTH ALSO Assembler DEFINITIONS ( set search order to ... FORTH Assembler Assembler )
: VOCABULARY ( -- ) CREATE WORDLIST , DOES> ( -- ) @ >R GET-ORDER SWAP DROP R> SWAP SET-ORDER ;
Add the following ambigous condition to 220.127.116.11:
- executing a vocabulary word when the search order is empty (18.104.22.16800)