OpenBoot 2.x Command Reference Manual

Searching the Dictionary

The dictionary contains all the available Forth commands. Table 4-8 lists tools you can use to search the dictionary.

Table 4-8 Dictionary Searching Commands

Command  

Stack Diagram 

Description 

' name

( -- xt ) 

Find the named word in the dictionary. Returns the execution token. Use outside definitions. 

['] name

( -- xt ) 

Similar to ' but is used either inside or outside definitions.

.calls

( xt -- ) 

Display a list of all words that call the word whose execution token is xt.

$find

( addr len -- addr len false | xt n ) 

Find a word. n = 0 if not found, n = 1 if immediate, n = -1 otherwise.

find

( pstr -- pstr false | xt n ) 

Search for a word in the dictionary. The word to be found is indicated by pstr. n = 0 if not found, n = 1 if immediate, n = -1 otherwise.

see thisword

( -- ) 

Decompile the named command. 

(see)

( xt -- ) 

Decompile the word indicated by the execution token. 

sift

( pstr -- ) 

Display names of all dictionary entries containing the string pointed to by pstr.

sifting ccc

( -- ) 

Display names of all dictionary entries containing the sequence of characters. ccc contains no spaces.

words

( -- )  

Display all visible words in the dictionary. 

see, used in the form see thisword, decompiles the specified command (that is, it shows the definition used to create thisword). The decompiled definition may sometimes be confusing, because some internal names may have been omitted from the PROM's symbol table to save space.

The following screen is an example of how to use sifting.


ok sifting input 
input-device input restore-input line-input input-line input-file
ok 

words displays all the word (command) names in the dictionary, starting with the most recent definitions.