How to list the current word set in Forth

Can I get a list of all the words that are currently defined in Forth (e.g. Gforth )?

+5
source share
1 answer

The standard word WORDS prints only all words from the upper dictionary (list of words) - see the specification .

The TRAVERSE-WORDLIST clause defines an API for listing words in a given word list. Some Forth systems have already implemented this proposal.

Although there is no standard API for listing all defined word lists. GET-ORDER lists only contextual wordlists (i.e. text lists in a scope).

Some Forth systems have the word VOCS that prints all defined dictionaries. Other possible APIs are specific to a particular Forth system. For example, SP-Forth has the word ENUM-VOCS to list all known word lists.

+6
source

Source: https://habr.com/ru/post/1260371/


All Articles