RENAME:
Factor documentation > Factor handbook > The language > Syntax > Parse-time word lookup > Syntax to control word lookup
Prev:EXCLUDE:
Next:UNUSE:


Vocabulary
syntax

Syntax
RENAME: word vocab => new-name


Word description
Imports word from vocab, but renamed to new-name.

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

Examples
USING: prettyprint ; RENAME: + math => - 2 3 - .
5


Definition
USING: lexer vocabs.parser ;

IN: syntax

SYNTAX: RENAME:
scan-token scan-token "=>" expect
scan-token add-renamed-word ;