Is it possible to get the list of all words which are currently defined in Forth (for example in Gforth)?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With