include

[syntax] include filename

ChezScheme: Expands into a begin form containing the Scheme forms found in filename. Can be used other than toplevel.

If filename is not an absolute path, it is searched in the directories in a parameter source-directories.

Chicken: Inserts the contents of filename as the toplevel definitions.

If filename is not an absolute path, it is searched first in the current directory, then in the directories given by the command-line argument -include-path. The extension of the filename can be omitted if it is ".scm".

[syntax] include path-spec

PLT-Scheme: Inlines the syntax in the file desginated by path-spec in place of this form. path-spec can be just a string, or (file string), or (lib string ...).

If path-spec is not an absolute, path, it is resolved as follows.

  • If the source that contains the include form has complete path string, use it as a base.
  • Otherwise, if (current-load-relative-directory?) is not #f, use it as a base.
  • Otherwise, use (current-directory) as a base.

PLT has some other variations of includes: include-at/relative-to?, include/reader?, include-at/relative-to/reader?.