Make sure a feature is present, and load it if not
require (String_Type feature [,String_Type file])
The require function ensures that a specified "feature" is present.
If the feature is not present, the require function will attempt to load the feature from a file. If called with two arguments, the feature will be loaded from the file specified by the second argument. Otherwise, the feature will be loaded from a file given by the name of the feature, with ".sl" appended.
If, after loading the file, the feature is not present, a warning message will be issued.
"feature" is an abstract quantity that is undefined here.
A popular use of the require function is to ensure that a specified
file has already been loaded. In this case, the feature is the
filename itself. The advantage of using this mechanism over using evalfile is that if the file has already been loaded, require will not re-load it. For this to work, the file must indicate that it
provides the feature via the provide function.
|