require-when ( if then -- )
Factor handbook > The language > Vocabulary loader

Prev:require ( object -- )
Next:reload ( name -- )


Inputs and outputs
ifa sequence of vocabulary specifiers
thena vocabulary specifier

Word description
Loads the then vocabulary if it is not loaded and all of the if vocabulary is. If some of the if vocabularies are not loaded now, but they are later, then the then vocabulary will be loaded along with the final one.

This is used to express a joint dependency of vocabularies. If vocabularies a and b use code in vocabulary c to interact, then the following line, which can be placed in a or b, expresses the dependency.
{ "a" "b" } "c" require-when