1 Running Top-Level Programs
To run a top-level program, either:
Use the plt-r6rs executable, supplying the file that contains the program on the command line:
plt-r6rs 〈program-file〉
Additional command-line arguments are propagated as command-line arguments to the program (accessed via command-line).
To compile the file to bytecode (to speed future runs of the program), use plt-r6rs with the --compile flag:
plt-r6rs --compile 〈program-file〉
The bytecode file is written in a "compiled" sub-directory next to 〈program-file〉.
For example, if "hi.scm" contains
(import (rnrs))
(display "hello\n")
then
plt-r6rs hi.scm
prints “hello.”
Prefix the program with #lang r6rs from the PLT Scheme perspective. Such files can be run like any other PLT Scheme module, such as using mzscheme:
, which counts as a comment from the R6RS perspective, but is a synonym formzscheme 〈program-file〉
or using DrScheme with the Module language. The file can also be compiled to bytecode using mzc:
mzc 〈program-file〉
For example, if "hi.ss" contains
(import (rnrs))
(display "hello\n")
then
mzscheme hi.ss
prints “hello.” Similarly, opening "hi.ss" in DrScheme and clicking Run prints “hello” within the DrScheme interactions window.