Handbook
Glossary
Vocabularies
Factor handbook
ยป
The implementation
Prev:
Definitions
Next:
Source files
A
vocabulary
is a named collection of
Words
. Vocabularies are defined in the
vocabs
vocabulary.
Vocabularies are stored in a global hashtable:
dictionary
Vocabularies form a class.
vocab
vocab?
( object -- ? )
Various vocabulary words are overloaded to accept a
vocabulary specifier
, which is a string naming the vocabulary, the
vocab
instance itself, or a
vocab-link
:
vocab-link
>vocab-link
( name -- vocab )
Looking up vocabularies by name:
vocab
Accessors for various vocabulary attributes:
vocab-name
( vocab-spec -- name )
vocab-main
( vocab-spec -- main )
vocab-help
( vocab-spec -- help )
Looking up existing vocabularies and creating new vocabularies:
lookup-vocab
( vocab-spec -- vocab )
loaded-child-vocab-names
( vocab-spec -- seq )
create-vocab
( name -- vocab )
Getting words from a vocabulary:
vocab-words-assoc
( vocab-spec -- assoc/f )
vocab-words
( vocab-spec -- seq )
all-words
( -- seq )
words-named
( str -- seq )
Removing a vocabulary:
forget-vocab
( vocab -- )
See also
Words
,
Vocabulary loader
,
Parse-time word lookup