Next: , Previous: , Up: Running Scheme   [Contents][Index]


1.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:

--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 (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, all.com; in these cases the library directories are searched, but not the working directory.

--heap blocks

Specifies the size of the heap in 1024-word blocks. Overrides any default. 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 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 Bourne shell, 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:

mit-scheme < /usr/cph/foo.in > /usr/cph/foo.out 2>&1 &
--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.

--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. The elements of the list are separated by colons. The default value is /usr/local/lib/mit-scheme-pucked (unless you configured Scheme to install in a different --prefix, see Build Configuration).

--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 --band option. This option is useful only for maintenance and development of the MIT/GNU Scheme runtime system.

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 ${HOME}/.scheme.init or scheme.ini file, normally loaded automatically when Scheme starts (if it exists).

--suspend-file

Scheme can write out a file called scheme_suspend in the user’s home directory when Scheme is terminated by the ‘SIGUSR1’, ‘SIGHUP’, or ‘SIGPWR’ signals. 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 options allow arguments to be passed to scripts via the command-line-arguments procedure.

procedure: command-line-arguments

Returns a list of arguments (strings) gathered from the command-line by options like --args or --.

Note that this was named command-line in MIT/GNU Scheme release 9.2 and earlier, but has been renamed to avoid a conflict with R7RS.

--args argument

This option causes Scheme to append the arguments, up to (but not including) the next argument that starts with a hyphen, to the list returned by the command-line-arguments procedure.

-- argument

This option causes Scheme to append the rest of the command-line arguments (even those starting with a hyphen) to the list returned by the command-line-arguments procedure.

--edit

This option causes Edwin to be loaded and started immediately when Scheme is started.


Next: , Previous: , Up: Running Scheme   [Contents][Index]