#
Chapter 2
Basic mode of operation

The compiler translates Scheme source code into fairly portable C that can be compiled and linked with most available C compilers. Separate compilation is supported by so-called units. A unit is a single compiled object module that contains a number of toplevel expressions that are executed either when the unit is the main unit or if the unit is used. To use a unit, the unit has to be declareed as used, like this:

    (declare (uses UNITNAME))

The toplevel expressions of used units are executed in the order in which the units appear in the `uses` declaration. Units may be used multiple times and `uses` declarations may be circular (the unit is initialized at most once). To compile a file as a unit, add a `unit` declaration:

    (declare (unit UNITNAME))

When compiling different object modules, make sure to have one main unit. This unit is called initially and initializes all used units before executing its toplevel expressions. The main-unit has no `unit` declaration.

Another method of using definitions in separate source files is to include them. This simply inserts the code in a given file into the current file:

    (include "FILENAME")

One important thing: macro definitions are only available when included. Macro definitions in separate units are not available, since they are defined at compile time, i.e the time when that other unit was compiled. (macros defined using the low-level macro system are also available at runtime, see `define-macro`).