1MZSCHEME(1) General Commands Manual MZSCHEME(1)
2
3
4
6 mzscheme - The PLT Scheme implementation
7
9 mzscheme [ option ... ] [ argument ... ]
10
12 MzScheme is the PLT Scheme implementation. It implements the language
13 as described in the Revised^5 Report on the Algorithmic Language Scheme
14 and adds numerous extensions.
15
16 MrEd embeds and extends MzScheme with a graphical user interface (GUI)
17 toolbox.
18
19 DrScheme is the graphical development environment for creating MzScheme
20 and MrEd applications.
21
22
24 -e expr, --eval expr
25 Evaluates expr after MzScheme starts.
26
27 -f file, --load file
28 Loads file after MzScheme starts.
29
30 -d file, --load-cd file
31 Load/cds file after MzScheme starts.
32
33 -t file, --require file
34 Requires file after MzScheme starts.
35
36 -F, --Load
37 Loads all remaining arguments after MzScheme starts.
38
39 -D, --Load-cd
40 Load/cds all remaining arguments after MzScheme starts.
41
42 -T, --Require
43 Requires all remaining arguments after MzScheme starts.
44
45 -l file, --mzlib file
46 Same as -e '(require (lib "file"))'.
47
48 -L file coll
49 Same as -e '(require (lib "file" "coll"))'.
50
51 -M coll
52 Same as -e '(require (lib "coll.ss" "coll"))'.
53
54 -p file user package
55 Same as -e '(require (planet "file" "user" "package"))'.
56
57 -P name user
58 Same as -e '(require (planet "name.ss" "user" "name.plt"))'.
59
60 -r, --script
61 Script mode: use as last flag for scripts. Same as -fmv-.
62
63 -i, --script-cd
64 Like -r, but also sets the directory. Same as -dmv-.
65
66 -u, --require-script
67 Like -r, but requires a module. Same as -tmv-.
68
69 -w, --awk
70 Same as -l awk.ss.
71
72 -k n m
73 Load executable-embedded code from file offset n to m.
74
75 -C, --main
76 Like -r, then calls `main' with a list of argument strings. The
77 first string in the list is the name of the loaded file, and the
78 rest of the list contains leftover command-line arguments.
79
81 -X dir, --collects dir
82 Sets dir as the location of the main "collects" directory. If
83 dir is relative, it is relative to the executable.
84
85 -S dir
86
87 --search dir
88 Adds dir to the search path for library collections. If dir is
89 relative, it is relative to the executable.
90
91 -U, --no-user-path
92 Ignores PLTHOME, and omits the user-specific "collects" direc‐
93 tory from the search path for library collections.
94
95 -x, --no-lib-path
96 Skips trying to set current-library-collection-paths.
97
98 -q, --no-init-file
99 Skips trying to load "~/.mzschemerc".
100
101 -N file, --name file
102 Sets the program name to name.
103
104 -A, --no-argv
105 Skips defining `argv' and `program'.
106
108 -Q, --prim
109 Assume primitive bindings at top level by initializing the envi‐
110 ronment with `(require mzscheme)'.
111
112 -g, --case-sens
113 Identifiers and symbols are initially case-sensitive (the
114 default).
115
116 -G, --case-insens
117 Identifiers and symbols are initially case-insensitive.
118
119 -s, --set-undef
120 Set! works on undefined identifiers.
121
123 --
124 No argument following this switch is used as a switch.
125
126 -p, --persistent
127 Catches AIX SIGDANGER (low page space) signal. (AIX only)
128
129 -m, --mute-banner
130 Suppresses the startup banner.
131
132 -v, --version
133 Suppresses the read-eval-print loop.
134
135 -h, --help
136 Shows help for command-line arguments.
137
138
140 Multiple single-letter switches can be collapsed, with arguments placed
141 after the collapsed swicthes; the first collapsed switch cannot be --.
142 E.g.: -vfme file expr is the same as -v -f file -m -e expr.
143
144 Extra arguments following the last option are put into the Scheme
145 global variable `argv' as a vector of strings. The name used to start
146 MzScheme is put into the global variable `program' as a string.
147
148 Expressions/files are evaluated/loaded in order as provided, including
149 calls to main implied by --main, embedded segments loaded by -k, and so
150 on. An uncaught exception during an evaluation/load causes later evalu‐
151 ations/loads to be skipped.
152
153 The current-library-collections-paths parameter is automatically set
154 before any expressions/files are evaluated/loaded, unless the -x or
155 --no-lib-path option is used.
156
157
159 If the executable name has the form scheme-dialect, then the command
160 line is effectively prefixed with
161 -qAeC '(require (lib "init.ss" "script-lang" "dialect"))'
162 The first actual command-line argument thus serves as the name of a
163 file to load. The file should define main, which is called with the
164 command-line arguments---starting with the loaded file name---as a list
165 of immutable strings.
166
167
169 The file "~/.mzschemerc" is loaded before any provided expres‐
170 sions/files are evaluated/loaded, unless the -q or --no-init-file
171 option is used.
172
173 Unless the -U or --no-user-path option is provided, the library collec‐
174 tions search path is read from the PLTCOLLECTS environment variable (as
175 a colon-separated list of paths). Where the empty path appears in PLT‐
176 COLLECTS, it is replaced with the default collections directory search
177 path.
178
179
181 The most flexible way to create an executable script file is to trampo‐
182 line through /bin/sh, using a #| ... |# block-comment trick to make the
183 first few lines parseable by both /bin/sh and mzscheme. Here's an exam‐
184 ple:
185
186 #! /bin/sh
187 #|
188 exec mzscheme -qr "$0" ${1+"$@"}
189 |#
190 (display "Hello, world!")
191 (newline)
192
193
195 For further information on MzScheme, please consult the on-line docu‐
196 mentation and other information available at
197
198 http://www.plt-scheme.org/software/mzscheme/
199
200
202 Submit bug reports via
203 http://bugs.plt-scheme.org/ (encouraged)
204 or by e-mail to
205 bugs@plt-scheme.org (discouraged)
206
208 MzScheme was implemented by Matthew Flatt (mflatt@plt-scheme.org). It
209 uses the conservative garbage collector implemented by Hans Boehm and
210 extended by John Ellis. MzScheme was originally based on libscheme,
211 written by Brent Benson.
212
214 help-desk(1), drscheme(1), mred(1)
215
216
217
2184th Berkeley Distribution February 2007 MZSCHEME(1)