To load files of Scheme code, use the procedure load
:
load
determines whether the file to be loaded is binary or source
code, and performs the appropriate action. By convention, files of
source code have a pathname type of "scm"
, and files of binary
SCode have pathname type "bin"
. Native-code binaries have
pathname type "com"
. (See the description of
pathname-type
in the reference manual.)
load-noisily?
is set to #t
, load
will print the
value of each expression in the file as it is evaluated. Otherwise,
nothing is printed except for the value of the last expression in the
file. (Note: the noisy loading feature is implemented for source-code
files only.)
load/default-types
is a list of associations that maps
pathname types (strings) to loader procedures. load
tries the
pathname types in the order that they appear in the list. The initial
value of this variable has pathname types in this order:
"com" "so" "sl" "bin" "scm"
This means that, for example, (load "foo")
will try to load
`foo.com' first, and `foo.scm' only after looking for and
failing to find the other pathname types.
All pathnames are interpreted relative to a working directory, which is
initialized when Scheme is started. The working directory can be
obtained from the procedure pwd
or modified by the procedure
cd
; see the reference manual for details. Files may be loaded
when Scheme first starts; see the -load
command line option for
details.