In Scheme R7RS there is both a load
and include
form.
Include is described as:
Semantics: Both include and include-ci take one or more filenames expressed as string literals, apply an implementation-specific algorithm to find corresponding files, read the contents of the files in the specified order as if by repeated applications of read, and effectively re- place the include or include-ci expression with a begin expression containing what was read from the files. The difference between the two is that include-ci reads each file as if it began with the #!fold-case directive, while include does not. Note: Implementations are encouraged to search for files in the directory which contains the including file, and to provide a way for users to specify other directories to search.
Load is described as:
An implementation-dependent operation is used to trans- form filename into the name of an existing file con- taining Scheme source code. The load procedure reads expressions and definitions from the file and evalu- ates them sequentially in the environment specified by environment-specifier. If environment-specifier is omitted, (interaction-environment) is assumed. It is unspecified whether the results of the expres- sions are printed. The load procedure does not af- fect the values returned by current-input-port and current-output-port. It returns an unspecified value. Rationale: For portability, load must operate on source files. Its operation on other kinds of files necessarily varies among implementations.
What is the rationale for the two forms? I assume it is historic. Is there any import semantic difference between the two forms? I see that load
can optionally include an environment specifier and include
doesn't have that. And include-ci
has no direct equivalent using load
. But comparing load
and include
alone, what is the difference and is it important?