FROM:
Factor handbook » The language » Syntax » Parse-time word lookup » Syntax to control word lookup

Prev:QUALIFIED-WITH:
Next:EXCLUDE:


Vocabulary
syntax

Syntax
FROM: vocab => words ... ;


Word description
Adds words from vocab to the search path.

Notes
If adding the words introduces ambiguity, the words will take precedence when resolving any ambiguous names.

Examples
Both the vocabs.parser and binary-search vocabularies define a word named search. The following will throw an ambiguous-use-error:
USING: vocabs.parser binary-search ; ... search ...

Because FROM: takes precedence over a USING:, the ambiguity can be resolved explicitly. Suppose you wanted the binary-search vocabulary's search word:
USING: vocabs.parser binary-search ; FROM: binary-search => search ; ... search ...


Definition