8

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
ivand58
  • 773
  • 6
  • 19

1 Answers1

10

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.

ruvim
  • 7,151
  • 2
  • 27
  • 36