Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to list the current set of words in Forth

Tags:

forth

gforth

Is it possible to get the list of all words which are currently defined in Forth (for example in Gforth)?

like image 873
ivand58 Avatar asked Nov 25 '16 18:11

ivand58


1 Answers

Standard WORDS word prints all the words from the top vocabulary (wordlist) only — see the specification .

TRAVERSE-WORDLIST proposal defines API to enumerate words in given wordlist. Some Forth-systems already implemented this proposal ([update] it is already in the draft).

Although there is no standard API to enumerate all defined wordlists. GET-ORDER gives a list of the context wordlists only (i.e. wordlists in the scope).

Some Forth-systems have VOCS word that prints all defined vocabularies. Other possible APIs are specific for particular Forth-system. For example, SP-Forth has ENUM-VOCS word to enumerate all known wordlists.

like image 138
ruvim Avatar answered Sep 29 '22 14:09

ruvim