Working with code outside of the Factor source tree
Factor handbook » The language » Vocabulary loader » Vocabulary roots


You can work with code outside of the Factor source tree by adding additional directories to the list of vocabulary roots.

There are four ways of doing this:

The first way is to use an environment variable. Factor looks at the FACTOR_ROOTS environment variable for a list of :-separated paths (on Unix) or a list of ;-separated paths (on Windows).

The second way is to use the -roots= command-line argument. The format is the same as for the environment variable.

The third way is to create a configuration file. You can list additional vocabulary roots in a file that Factor reads at startup:
Additional vocabulary roots file

Finally, you can add vocabulary roots by calling a word from your .factor-rc file (see Startup initialization file):
add-vocab-root ( root -- )