Debian Codegraph @

doc/gosh.1.in

raw
1 .\" -*-nroff-*-
2 .TH "GOSH" "1" "" "Gauche @GAUCHE_VERSION@" "Gauche Commands"
3 .SH NAME
4 gosh \- a Scheme script interpreter
5 .SH SYNOPSIS
6 .B gosh
7 [-bhiqV]
8 [-I
9 .I path
10 ]
11 [-A
12 .I path
13 ]
14 [-u
15 .I module
16 ]
17 [-l
18 .I file
19 ]
20 [-L
21 .I file
22 ]
23 [-e
24 .I expr
25 ]
26 [-E
27 .I expr
28 ]
29 [-m
30 .I module
31 ]
32 [-f
33 .I flag
34 ]
35 [-F
36 .I feature
37 ]
38 [-p
39 .I type
40 ]
41 [-r
42 .I standard
43 ]
44 [--]
45 [
46 .I script argument ...
47 ]
48 .br
49 .sp 0.3
50 .SH DESCRIPTION
51 .I Gosh
52 is a stand-alone Scheme interpreter built on top of the
53 .I Gauche
54 Scheme script engine.
55
56 When
57 .I script
58 is given, gosh loads the script, evaluating Scheme code in it.
59 Then, if the
60 .I script
61 defines a procedure named
62 .I main,
63 gosh calls it with a single argument which is a list of
64 the script name and subsequent arguments.
65 When
66 .I main
67 returns an integer value, gosh exits with it as an exit code.
68 If
69 .I main
70 returns non-integer value, or an error is signaled during
71 evaluation, gosh exits with exit code 70 (EX_SOFTWARE).
72 See SRFI-22 (http://srfi.schemers.org/srfi-22/srfi-22.html) for
73 details.
74 If there's no
75 .I main
76 procedure defined in the script, gosh exits with code 0
77 after loading the script file.
78
79 If no script file is given, gosh goes into an interactive mode.
80 By default, gosh prompts the user to enter a Scheme expression,
81 read and evaluates it, then prints the result, until EOF is read.
82 If the standard input is not a terminal, however, gosh doesn't
83 print a prompt; it allows a user to use gosh as a filter program.
84 This behavior can be controlled by -i or -b option; see below.
85
86 .SH OPTIONS
87 Command line options are processed before loading the script file
88 or entering the interactive mode.
89
90 The options -I, -A, -u, -l, -L, -e and -E are processed in the order
91 of appearance. For example, adding a load path by -I option
92 affects the -l options after it, but not the ones before it.
93
94 .TP 5
95 .BI -V
96 Prints gosh version and exits.
97 .TP
98 .BI -b
99 Batch mode. Doesn't print prompt even the standard input
100 is a terminal. Supersedes -i.
101 .TP
102 .BI -h
103 Print help message to stdout and exit with 0.
104 .TP
105 .BI -i
106 Interactive mode. Forces to print prompt, even the standard input
107 is not a terminal.
108 .TP
109 .BI -q
110 Prevents reading the default initialization file.
111 .TP
112 .BI -I path
113 Adds
114 .I path
115 in front of the load path list.
116 .TP
117 .BI -A path
118 Appends
119 .I path
120 to the tail of the load path list.
121 .TP
122 .BI -u module
123 Loads and imports
124 .I module,
125 as if "(use
126 .I module
127 )" is specified in the code.
128 .TP
129 .BI -l file
130 Loads a Scheme file
131 .I file.
132 .TP
133 .BI -L file
134 Like -l, but doesn't complain if
135 .I file
136 doesn't exist.
137 .TP
138 .BI -e expr
139 Evaluates a Scheme expression
140 .I expr.
141 .TP
142 .BI -E expr
143 Same as -e, except that the
144 .I expr
145 is read as if it is surrounded by parenthesis.
146 .TP
147 .BI -m module
148 When the script file is given, this option specifies the name of
149 the module in which the "main" procedure is defined.
150 The default is "user".
151 .TP
152 .BI -p type
153 Turns on the profiler.
154 .I Type
155 can be either 'time' or 'load'.
156 .TP
157 .BI -r standard
158 Starts gosh with the default environment defined
159 in RnRS, where n is determined by
160 .I standard.
161 Currently, only 7 is the valid value of
162 .I standard.
163 .TP
164 .BI -v version
165 If
166 .I version
167 is not the running Gauche's version, but the specified verision
168 is installed in the system, execute that version's gosh instead.
169 This is useful when you want to invoke a specific version of Gauche.
170 The version must be 0.9.6 or later.
171 .TP
172 .BI -f flag
173 Sets various flags.
174 case-fold use case-insensitive reader (as in R5RS)
175 load-verbose report while loading files
176 include-verbose report while including files
177 no-inline don't inline primitive procedures and constants
178 (combined no-inline-globals, no-inline-locals,
179 no-inline-constants and no-inline-setters.)
180 no-inline-globals don't inline global procedures.
181 no-inline-locals don't inline local procedures.
182 no-inline-constants don't inline constants.
183 no-inline-setters don't inline setters.
184 no-post-inline-pass don't run post-inline optimization pass.
185 no-lambda-lifting-pass don't run lambda lifting optimization pass.
186 no-post-inline-pass don't run post-inline optimization pass.
187 no-source-info don't retain source information.
188 read-edit enable input editing mode, if terminal supports it.
189 no-read-edit disable input editing mode.
190 safe-string-cursors performs extra validation for use of string cursors.
191 warn-legacy-syntax print warning when legacy Gauche syntax
192 is encountered.
193 test assume being run in the build tree; tries to
194 load files from the current build instead of
195 installation directories. Useful to test
196 the build without installation.
197 .TP
198 .BI -F feature
199 Makes
200 .I feature
201 available in cond-expand forms.
202 .TP
203 .BI --
204 Specifies that there are no more options. If there are more
205 arguments after this, they are taken as script file name and
206 its arguments.
207
208 .SH ENVIRONMENT
209 .TP
210 .B GAUCHE_LOAD_PATH
211 .TQ
212 A colon separated list of the load paths.
213 The paths are appended before the system default load paths.
214 .TP
215 .B GAUCHE_DYNLOAD_PATH
216 .TQ
217 A colon separated list of the load paths for dynamically loaded
218 objects.
219 The paths are appended before the system default load paths.
220
221 .SH AUTHORS
222 Shiro Kawai (shiro @ acm . org)
223
224 .SH SEE ALSO
225 gauche-config(1)
226 .PP
227 Gauche Scheme script engine:
228 .br
229 https://practical-scheme.net/gauche/
230 .PP
231 For the information about Scheme language, see
232 .br
233 https://www.schemers.org/