2.4 Command-Line Options
Scheme accepts the command-line options detailed in the following
sections. The options may appear in any order, with the restriction
that the microcode options must appear before the runtime options, and
the runtime options must appear before any other arguments on the
command line. Any arguments other than these options will generate a
warning message when Scheme starts. If you want to define your own
command-line options, see Custom Command-line Options.
Note that MIT/GNU Scheme supports only long options, that
is, options specified by verbose names, as opposed to short
options, which are specified by single characters. As of release 7.7.90,
all options start with two hyphens, for compatibility with GNU
coding standards (and most modern programs). Prior to this release,
options started with a single hyphen. While the single-hyphen style
continues to work, it is deprecated and will someday stop working.
These are the microcode options:
- --compiler
- This option specifies defaults appropriate for loading the compiler. It
specifies the use of large sizes, exactly like --large; if the
--band option is also specified, that is the only effect of
this option. Otherwise, the default band's filename is the value of the
environment variable MITSCHEME_COMPILER_BAND, if defined, or
compiler.com; the library directories are searched to locate this
file.
- --edwin
- This option specifies defaults appropriate for loading the editor. It
specifies the use of large sizes, exactly like --large; if the
--band option is also specified, that is the only effect of
this option. Otherwise, the default band's filename is the value of the
environment variable MITSCHEME_EDWIN_BAND, if defined, or
edwin.com; the library directories are searched to locate this
file.
- --compiler --edwin
- If both the --compiler and --edwin options are given,
Scheme will load an environment containing both the compiler and the
editor. The default band's filename is the value of the environment
variable MITSCHEME_ALL_BAND, if defined, or all.com; the
library directories are searched to locate this file.
- --band filename
- Specifies the initial world image file (band) to be loaded.
Searches for filename in the working directory and the library
directories, using the full pathname of the first readable file of that
name. If filename is an absolute pathname (on unix, this means it
starts with /), then no search occurs—filename is
tested for readability and then used directly. If this option isn't
given, the filename is the value of the environment variable
MITSCHEME_BAND, or if that isn't defined, runtime.com; in
these cases the library directories are searched, but not the working
directory.
- --large
- Specifies that large heap, constant, and stack sizes should be used.
These are specified by the environment variables
MITSCHEME_LARGE_HEAP
MITSCHEME_LARGE_CONSTANT
MITSCHEME_LARGE_STACK
If this option isn't given, the small sizes are used, specified by the
environment variables
MITSCHEME_SMALL_HEAP
MITSCHEME_SMALL_CONSTANT
MITSCHEME_SMALL_STACK
There are reasonable built-in defaults for all of these environment
variables, should any of them be undefined. Note that any or all of the
defaults can be individually overridden by the --heap,
--constant, and --stack options.
Note: the Scheme expression ‘(print-gc-statistics)’ shows how much
heap and constant space is available and in use (see Garbage Collection).
- --heap blocks
- Specifies the size of the heap in 1024-word blocks. Overrides any
default. Normally two such heaps are allocated; bchscheme
allocates only one, and uses a disk file for the other.
The size specified by this option is incremented by the amount of heap
space needed by the band being loaded. Consequently, --heap
specifies how much free space will be available in the heap when Scheme
starts, independent of the amount of heap already consumed by the band.
- --constant blocks
- Specifies the size of constant space in 1024-word blocks. Overrides any
default. Constant space holds the compiled code for the runtime system
and other subsystems.
- --stack blocks
- Specifies the size of the stack in 1024-word blocks. Overrides any
default. This is Scheme's stack, not the unix stack used by C
programs.
- --option-summary
- Causes Scheme to write an option summary to standard error. This shows
the values of all of the settable microcode option variables.
- --emacs
- Specifies that Scheme is running as a subprocess of GNU Emacs.
This option is automatically supplied by GNU Emacs, and should
not be given under other circumstances.
- --interactive
- If this option isn't specified, and Scheme's standard I/O is
not a terminal, Scheme will detach itself from its controlling terminal,
which prevents it from getting signals sent to the process group of that
terminal. If this option is specified, Scheme will not detach itself
from the controlling terminal.
This detaching behavior is useful for running Scheme as a background
job. For example, using bash, the following will run Scheme
as a background job, redirecting its input and output to files, and
preventing it from being killed by keyboard interrupts or by logging
out:
scheme < /usr/cph/foo.in > /usr/cph/foo.out 2>&1 &
This option is ignored under non-unix operating systems.
- --nocore
- Specifies that Scheme should not generate a core dump under any
circumstances. If this option is not given, and Scheme terminates
abnormally, you will be prompted to decide whether a core dump should be
generated.
This option is ignored under non-unix operating systems.
- --library path
- Sets the library search path to path. This is a
list of directories that is searched to find various library files, such
as bands. If this option is not given, the value of the environment
variable MITSCHEME_LIBRARY_PATH is used; if that isn't defined,
the default is used.
On unix, the elements of the list are separated by colons, and the
default value is /usr/local/lib/mit-scheme. On PCs, the elements
of the list are separated by semicolons, and the default value is
c:\scheme\lib.
- --utabmd filename
- Specifies that filename contains the microcode tables (the
microcode tables are information that informs the runtime system about
the microcode's structure). Filename is searched for in the
working directory and the library directories. If this option isn't
given, the filename is the value of the environment variable
MITSCHEME_UTABMD_FILE, or if that isn't defined,
utabmd.bin; in these cases the library directories are searched,
but not the working directory.
--utab is an alternate name for the --utabmd option;
at most one of these options may be given.
- --fasl filename
- Specifies that a cold load should be performed, using
filename as the initial file to be loaded. If this option isn't
given, a normal load is performed instead. This option may not be used
together with the --compiler, --edwin, or
--band options. This option is useful only for maintenance and
development of the MIT/GNU Scheme runtime system.
In addition to the above, bchscheme recognizes the following
command-line options, all of which specify parameters affecting how
bchscheme uses disk storage to do garbage collection:
- --gc-directory directory
- Specifies that directory should be used to create files for
garbage collection. If the option is not given, the value of
environment variable MITSCHEME_GC_DIRECTORY is used instead, and
if that is not defined, a standard temporary directory is used (see
TMPDIR in see Runtime Environment Variables).
- --gc-file filename
- Specifies that filename should be used for garbage collection. If
the option is not given, the value of environment variable
MITSCHEME_GC_FILE is used, and if this is not defined, a unique
filename is generated in the directory specified with
--gc-directory.
--gcfile is an alias for --gc-file; at most one of
these options should be specified.
- --gc-keep
- Specifies that the GC file used for garbage collection should
not be deleted when Scheme terminates. The GC file is deleted
only if the file was created by this invocation of Scheme, and this
option is not set.
- --gc-start-position number
- Specifies the first byte position in the GC file at which the
Scheme process can write. If not given, the value of the environment
variable MITSCHEME_GC_START_POSITION is used, and if that is not
defined, ‘0’ is used, meaning the beginning of the file. The area
of the file used (and locked if possible) is the region between
--gc-start-position and --gc-end-position.
- --gc-end-position number
- Specifies the last byte position in the GC file at which the
Scheme process can write. If not given, the value of the environment
variable MITSCHEME_GC_END_POSITION is used, and if that is not
defined, the sum of the start position (as specified by
--gc-start-position) and the heap size is used. The area of
the file used (and locked if possible) is the region between
--gc-start-position and --gc-end-position.
- --gc-window-size blocks
- Specifies the size of the windows into new space during garbage
collection. If this option is not given, the value of environment
variable MITSCHEME_GC_WINDOW_SIZE is used instead, and if that
is not defined, the value ‘16’ is used.
The following command-line options are only used by an experimental
version of bchscheme that uses unix System V-style shared
memory, and then only if the gcdrone program is installed in the
library directory.
- --gc-drone program
- Specifies that program should be used as the drone program for
overlapped I/O during garbage collection. If the option is
not given, the value of environment variable MITSCHEME_GC_DRONE is
used instead, and if that is not defined, gcdrone is used.
- --gc-read-overlap n
- Specifies that Scheme should delegate at most n simultaneous disk
read operations during garbage collection. If the option is not given,
the value of environment variable MITSCHEME_GC_READ_OVERLAP is
used instead, and if that is not defined, ‘0’ is used, disabling
overlapped reads.
- --gc-write-overlap n
- Specifies that Scheme should delegate at most n simultaneous disk
write operations during garbage collection. If the option is not given,
the value of environment variable MITSCHEME_GC_WRITE_OVERLAP is
used instead, and if that is not defined, ‘0’ is used, disabling
overlapped writes.
The following options are runtime options. They are processed after the
microcode options and after the image file is loaded.
- --no-init-file
- This option causes Scheme to ignore the ~/.scheme.init or
scheme.ini file, normally loaded automatically when Scheme starts
(if it exists).
- --suspend-file
- Under some circumstances Scheme can write out a file called
scheme_suspend in the user's home directory.1 This file is a world image containing the
complete state of the Scheme process; restoring this file continues the
computation that Scheme was performing at the time the file was written.
Normally this file is never written, but the --suspend-file
option enables writing of this file.
- --eval expression ...
- This option causes Scheme to evaluate the expressions following it
on the command line, up to (but not including) the next argument that
starts with a hyphen. The expressions are evaluated in the
user-initial-environment
. Unless explicitly handled, errors
during evaluation are silently ignored.
- --load file ...
- This option causes Scheme to load the files (or lists of files)
following it on the command line, up to (but not including) the next
argument that starts with a hyphen. The files are loaded in the
user-initial-environment
. Unless explicitly handled, errors
during loading are silently ignored.
The following option is supported only when Edwin is loaded.
- --edit
- This option causes Edwin to start immediately when Scheme is started.