[previous] [up] [next]     [index]
Next: Index Up: PLT MzScheme: Language Manual Previous: Transcripts: transcr.ss

Running MzScheme

The stand-alone version of MzScheme accepts a number of command-line flags. Under MacOS, a user can specify command-line flags by holding down the Command key while starting MzScheme, which provides a dialog for entering the command line. Dragging files onto the MzScheme icon in MacOS is equivalent to providing each file's name on the command line preceded by -f, so each file is loaded after MzScheme starts. When files are dragged onto MzScheme with the Command key pressed, the command line specified in the dialog is appended to the implicit command-line for loading the files.

MzScheme accepts the following flags:

Extra arguments following the last flag are put into the Scheme global variable argv as a vector of strings. The name used to start MzScheme is put into the global variable program as a string.

Multiple single-letter flags (the ones preceded by a single dash) can be collapsed into a single flag by concatenating the letters, as long as the the first flag is not -. The arguments for each flag are placed after the collapsed flags (in the order of the flags). For example,

  -vfme file expr 
and
  -v -f file -m -e expr 
are equivalent.

The current-library-collection-paths parameter is initialized (as described in Chapter 15) before any expression or file is evaluated or loaded, unless the -x or --no-lib-path flag is specified.

Unless the -q or --no-init-file flag is specified, a user initialization file is loaded after current-library-collection-paths parameter is initialized and before any other expression or file is evaluated or loaded. The path to the user initialization file is obtained from MzScheme's find-system-path procedure using 'init-file.

Expressions and files are evaluated and loaded in order that they are provided on the command line. If an error occurs, the remaining expressions and files are skipped. The thread that loads the files and evaluates the expressions is the main thread. When the main thread terminates (or is killed), the MzScheme process exits.

After the command-line files and expressions are loaded and evaluated, the main thread calls , unless the -v, --version, -r, --script, -i, --script-cd flag is specified.

The exit status for the MzScheme process indicates an error if an error occurs evaluating or loading a command-line expression or file and is not called afterwards, or if the default exit handler is called with an exact integer between 1 and 255.


[previous] [up] [next]     [index]
Next: Index Up: PLT MzScheme: Language Manual Previous: Transcripts: transcr.ss

PLT