996
|
1 .\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16)
|
|
2 .\"
|
|
3 .\" Standard preamble:
|
|
4 .\" ========================================================================
|
|
5 .de Sp \" Vertical space (when we can't use .PP)
|
|
6 .if t .sp .5v
|
|
7 .if n .sp
|
|
8 ..
|
|
9 .de Vb \" Begin verbatim text
|
|
10 .ft CW
|
|
11 .nf
|
|
12 .ne \\$1
|
|
13 ..
|
|
14 .de Ve \" End verbatim text
|
|
15 .ft R
|
|
16 .fi
|
|
17 ..
|
|
18 .\" Set up some character translations and predefined strings. \*(-- will
|
|
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
|
|
20 .\" double quote, and \*(R" will give a right double quote. \*(C+ will
|
|
21 .\" give a nicer C++. Capital omega is used to do unbreakable dashes and
|
|
22 .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff,
|
|
23 .\" nothing in troff, for use with C<>.
|
|
24 .tr \(*W-
|
|
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
|
|
26 .ie n \{\
|
|
27 . ds -- \(*W-
|
|
28 . ds PI pi
|
|
29 . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
|
|
30 . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
|
|
31 . ds L" ""
|
|
32 . ds R" ""
|
|
33 . ds C` ""
|
|
34 . ds C' ""
|
|
35 'br\}
|
|
36 .el\{\
|
|
37 . ds -- \|\(em\|
|
|
38 . ds PI \(*p
|
|
39 . ds L" ``
|
|
40 . ds R" ''
|
|
41 'br\}
|
|
42 .\"
|
|
43 .\" Escape single quotes in literal strings from groff's Unicode transform.
|
|
44 .ie \n(.g .ds Aq \(aq
|
|
45 .el .ds Aq '
|
|
46 .\"
|
|
47 .\" If the F register is turned on, we'll generate index entries on stderr for
|
|
48 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
|
|
49 .\" entries marked with X<> in POD. Of course, you'll have to process the
|
|
50 .\" output yourself in some meaningful fashion.
|
|
51 .ie \nF \{\
|
|
52 . de IX
|
|
53 . tm Index:\\$1\t\\n%\t"\\$2"
|
|
54 ..
|
|
55 . nr % 0
|
|
56 . rr F
|
|
57 .\}
|
|
58 .el \{\
|
|
59 . de IX
|
|
60 ..
|
|
61 .\}
|
|
62 .\"
|
|
63 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
|
64 .\" Fear. Run. Save yourself. No user-serviceable parts.
|
|
65 . \" fudge factors for nroff and troff
|
|
66 .if n \{\
|
|
67 . ds #H 0
|
|
68 . ds #V .8m
|
|
69 . ds #F .3m
|
|
70 . ds #[ \f1
|
|
71 . ds #] \fP
|
|
72 .\}
|
|
73 .if t \{\
|
|
74 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
|
|
75 . ds #V .6m
|
|
76 . ds #F 0
|
|
77 . ds #[ \&
|
|
78 . ds #] \&
|
|
79 .\}
|
|
80 . \" simple accents for nroff and troff
|
|
81 .if n \{\
|
|
82 . ds ' \&
|
|
83 . ds ` \&
|
|
84 . ds ^ \&
|
|
85 . ds , \&
|
|
86 . ds ~ ~
|
|
87 . ds /
|
|
88 .\}
|
|
89 .if t \{\
|
|
90 . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
|
|
91 . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
|
|
92 . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
|
|
93 . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
|
|
94 . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
|
|
95 . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
|
|
96 .\}
|
|
97 . \" troff and (daisy-wheel) nroff accents
|
|
98 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
|
|
99 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
|
|
100 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
|
|
101 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
|
|
102 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
|
|
103 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
|
|
104 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
|
|
105 .ds ae a\h'-(\w'a'u*4/10)'e
|
|
106 .ds Ae A\h'-(\w'A'u*4/10)'E
|
|
107 . \" corrections for vroff
|
|
108 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
|
|
109 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
|
|
110 . \" for low resolution devices (crt and lpr)
|
|
111 .if \n(.H>23 .if \n(.V>19 \
|
|
112 \{\
|
|
113 . ds : e
|
|
114 . ds 8 ss
|
|
115 . ds o a
|
|
116 . ds d- d\h'-1'\(ga
|
|
117 . ds D- D\h'-1'\(hy
|
|
118 . ds th \o'bp'
|
|
119 . ds Th \o'LP'
|
|
120 . ds ae ae
|
|
121 . ds Ae AE
|
|
122 .\}
|
|
123 .rm #[ #] #H #V #F C
|
|
124 .\" ========================================================================
|
|
125 .\"
|
|
126 .IX Title "INTERCALC 1p"
|
|
127 .TH INTERCALC 1p "2008-03-29" "perl v5.14.2" "User Contributed Perl Documentation"
|
|
128 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
|
129 .\" way too many mistakes in technical documents.
|
|
130 .if n .ad l
|
|
131 .nh
|
|
132 .SH "NAME"
|
|
133 intercalc \- CLC\-INTERCAL desk calculator
|
|
134 .SH "SYNOPSIS"
|
|
135 .IX Header "SYNOPSIS"
|
|
136 \&\fBintercalc\fR [options]
|
|
137 .SH "DESCRIPTION"
|
|
138 .IX Header "DESCRIPTION"
|
|
139 \&\fBintercalc\fR is a simple desk calculator, allowing the user to
|
|
140 enter \s-1INTERCAL\s0 statements (to see what they do) and expressions
|
|
141 (to see what value they produce); it uses an interpreter object
|
|
142 from CLC-INTERCAL to provide immediate feedback.
|
|
143 .PP
|
|
144 The desk calculator accepts several options, some of which are documented here.
|
|
145 .SS "User Interface Options"
|
|
146 .IX Subsection "User Interface Options"
|
|
147 .IP "\fB\-X\fR / \fB\-\-graphic\fR" 4
|
|
148 .IX Item "-X / --graphic"
|
|
149 Enters X\-based graphical user interface. Requires Perl-GTK. This is the
|
|
150 default if Perl-GTK is installed, the environment variable \fI\f(CI$DISPLAY\fI\fR is
|
|
151 set and the opening of the X display succeeds.
|
|
152 .IP "\fB\-c\fR / \fB\-\-curses\fR" 4
|
|
153 .IX Item "-c / --curses"
|
|
154 Enters full screen, curses-based interface. This is the default if the
|
|
155 X based interface cannot be started, the environment variable \fI\f(CI$TERM\fI\fR
|
|
156 is set and the terminal name is known.
|
|
157 .IP "\fB\-\-line\fR" 4
|
|
158 .IX Item "--line"
|
|
159 Enters the line-mode user interface. This is the default if the X based
|
|
160 and the curses based interfaces do not work.
|
|
161 .Sp
|
|
162 In this mode, the program executes each line from standard input according
|
|
163 to the current mode and language, and prints results to standard output.
|
|
164 A line starting with a backspark is interpreted as a command to the
|
|
165 calculator. Use backspark-g to \s-1GIVE\s0 \s-1UP\s0 (you'll need to do it twice), or
|
|
166 backspark-h to display the ehm, help page. Things which are available
|
|
167 via menu entries on the Curses and X interfaces are also available via
|
|
168 the backspark. For now, you can refer to the source code for a list.
|
|
169 .Sp
|
|
170 Command-line editing and command history is provided by the readline
|
|
171 library. Command completion works if the underlying compiler supports it
|
|
172 (the compilers provided with the distributions do).
|
|
173 .IP "\fB\-\-batch\fR" 4
|
|
174 .IX Item "--batch"
|
|
175 Avoids entering interactive mode. This is the default if the standard
|
|
176 input and output are not connected to a terminal and the X based interface
|
|
177 cannot be started. This mode is very similar to the line mode except that
|
|
178 command-line editing and command history are not implemented. Backspark
|
|
179 escapes work just the same.
|
|
180 .IP "\fB\-i\fR\fItype\fR / \fB\-\-interface\fR=\fItype\fR" 4
|
|
181 .IX Item "-itype / --interface=type"
|
|
182 Selects the user interface \fItype\fR. Currently, only \fIX\fR, \fICurses\fR,
|
|
183 \&\fILine\fR and \fINone\fR are defined, but more can be installed as compiler
|
|
184 plug-ins. If the interface selected is \fINone\fR, \fBintercalc\fR will work in
|
|
185 batch mode. In addition, an empty string will reinstate the default
|
|
186 behaviour.
|
|
187 .SS "Source language and compilation options"
|
|
188 .IX Subsection "Source language and compilation options"
|
|
189 .IP "\fB\-\-bug\fR=\fInumber\fR" 4
|
|
190 .IX Item "--bug=number"
|
|
191 Selects a different probability for the compiler bug. The compiler bug is
|
|
192 implemented by initialising the compiler's state with the required probability:
|
|
193 when a statement is compiled (usually at runtime), a \*(L"\s-1BUG\s0\*(R" instruction is
|
|
194 emitted with the required probability. The default is 1%.
|
|
195 .IP "\fB\-\-ubug\fR=\fInumber\fR" 4
|
|
196 .IX Item "--ubug=number"
|
|
197 Selects a probability for the unexplainable compiler bug. This is the compiler
|
|
198 bug which occurs when the probability of a (explainable) compiler bug is zero.
|
|
199 Only wimps would use this option. The default is 0.01%.
|
|
200 .IP "\fB\-I\fR\fIpath\fR / \fB\-\-include\fR=\fIpath\fR" 4
|
|
201 .IX Item "-Ipath / --include=path"
|
|
202 Adds a directory before the standard search path for compiler objects
|
|
203 and source code. If a file is accessible from the current directory,
|
|
204 it is never searched in any include path.
|
|
205 .Sp
|
|
206 If this option is repeated, the given paths will be searched in the
|
|
207 order given, followed by the standard paths.
|
|
208 .IP "\fB\-l\fR\fIlanguage\fR / \fB\-\-language\fR=\fIlanguage\fR" 4
|
|
209 .IX Item "-llanguage / --language=language"
|
|
210 Selects the language to use when interpreting user input. This should
|
|
211 correspond to the name of a compiler, which is an \s-1INTERCAL\s0 object
|
|
212 which was originally built by \fIiacc\fR. Only the expression and
|
|
213 statement parsers are used, so it is possible to test incomplete
|
|
214 compilers by loading them into \fIintercalc\fR even if they don't
|
|
215 work with \fIsick\fR. The default is obtained from the \fIsickrc\fR
|
|
216 option \fI.INTERCALC.LANGUAGE\fR.
|
|
217 .IP "\-\fB\-o\fR\fIoption\fR \-\fB\-\-option\fR=\fIoption\fR" 4
|
|
218 .IX Item "--ooption ---option=option"
|
|
219 Adds a language option. For example, \-\fB\-o\fR\fI3\fR selects base 3 calculation,
|
|
220 and \-\fB\-o\fR\fIwimp\fR selects wimp mode. If no options are provided, and the
|
|
221 default language was taken from the \fIsickrc\fR file, the default options
|
|
222 are taken from the \fIsickrc\fR file. Note that if an option or a language is
|
|
223 specified on the command line, the \fIsickrc\fR defaults are ignored.
|
|
224 .Sp
|
|
225 Unlike previous versions of \fIintercalc\fR, this version checks that the
|
|
226 options make sense in the context of the calculator; for example trying
|
|
227 to load a compiler as an option will cause an error, but a compiler
|
|
228 extension will be \s-1OK\s0.
|
|
229 .IP "\fB\-m\fR\fImode\fR / \fB\-\-mode\fR=\fImode\fR" 4
|
|
230 .IX Item "-mmode / --mode=mode"
|
|
231 Select operation mode. Currently, the only valid modes are \fIfull\fR,
|
|
232 \&\fIexpr\fR and \fIone\fR. See \*(L"Operating Modes\*(R". If this is not specified,
|
|
233 the default is taken from the \fIsickrc\fR option \fI..INTERCALC.MODE\fR.
|
|
234 .SS "Misc Options"
|
|
235 .IX Subsection "Misc Options"
|
|
236 .IP "\fB\-r\fR\fIname\fR / \fB\-\-rcfile\fR=\fIname\fR" 4
|
|
237 .IX Item "-rname / --rcfile=name"
|
|
238 Executes commands from file \fIname\fR before starting to accept input.
|
|
239 This option can be repeated, to execute more than one file. If it is
|
|
240 not specified, the standard library, the current directory, and the
|
|
241 current user's home directory are searched for files with name
|
|
242 \&\fIsystem.sickrc\fR or \fI.sickrc\fR, which are then executed. The order
|
|
243 for this search is: specified library (\fB\-\-include\fR), system library,
|
|
244 home directory, current directory. This is different from the search
|
|
245 order used when looking for objects or source code. If a directory
|
|
246 contains both \fI.sickrc\fR and \fIsystem.sickrc\fR, the \fIsystem.sickrc\fR
|
|
247 is executed first, followed by \fI.sickrc\fR. Also note that if the
|
|
248 current directory or the home directory appear in the search path
|
|
249 and contain one of these files, they will be executed twice.
|
|
250 .Sp
|
|
251 If filenames are explicitely specified, they must be fully qualified:
|
|
252 the search path is not used to find them.
|
|
253 .IP "\fB\-\-nouserrc\fR" 4
|
|
254 .IX Item "--nouserrc"
|
|
255 Prevents loading a user rcfile (.sickrc); also limits loading of
|
|
256 system.sickrc to the first one found. This option is normally only
|
|
257 used when testing the installation, to prevent interference from
|
|
258 previous versions of CLC-INTERCAL.
|
|
259 .SH "Operating Modes"
|
|
260 .IX Header "Operating Modes"
|
|
261 The calculator can operate in the following modes:
|
|
262 .IP "full Fully functional \s-1INTERCAL\s0 interpreter." 5
|
|
263 .IX Item "full Fully functional INTERCAL interpreter."
|
|
264 The calculator can parse and execute any statement or expression.
|
|
265 .Sp
|
|
266 Statements are compiled as a one-statement program, and executed;
|
|
267 any register value etc. will be preserved between statements, so
|
|
268 entering a list of statements is equivalent to running a program
|
|
269 in which all these statements are executed in sequence.
|
|
270 .Sp
|
|
271 It is important to note that some statements will not execute in
|
|
272 the normal manner. For example, a \s-1COME\s0 \s-1FROM\s0 will be parsed but
|
|
273 have no effect, unless it is something like:
|
|
274 .Sp
|
|
275 .Vb 1
|
|
276 \& (1) PLEASE COME FROM (1)
|
|
277 .Ve
|
|
278 .Sp
|
|
279 which causes the calculator to hang. On the other hand, an \s-1ABSTAIN\s0 \s-1FROM\s0
|
|
280 or a \s-1REINSTATE\s0 will work as expected, as will \s-1CREATE\s0 and \s-1DESTROY\s0.
|
|
281 A \s-1GIVE\s0 \s-1UP\s0 does not cause the calculator to terminate. One final
|
|
282 difference is that comments are not parsed, and therefore you get a
|
|
283 \&\*(L"Syntax Error\*(R" from the calculator rather than a splat *000 from the
|
|
284 \&\s-1INTERCAL\s0 interpreter.
|
|
285 .Sp
|
|
286 For expressions, the calculator READs \s-1OUT\s0 the expression's result.
|
|
287 Any side effects will be remembered, so if the expression contains
|
|
288 overloads they will remain to haunt the calculator.
|
|
289 .IP "expr \s-1INTERCAL\s0 expression interpreter" 5
|
|
290 .IX Item "expr INTERCAL expression interpreter"
|
|
291 The calculator can only parse expressions or assignments. In either
|
|
292 case, the calculated values are \s-1READ\s0 \s-1OUT\s0; assignments will also
|
|
293 store the value to the destination, while expressions will then
|
|
294 discard the result.
|
|
295 .IP "oic The \fBO\fRne \fBI\fRnstruction \fBC\fRalculator." 5
|
|
296 .IX Item "oic The One Instruction Calculator."
|
|
297 This is something we've made
|
|
298 up one early morning while discussing desk calculators (as one does).
|
|
299 It is not \s-1INTERCAL\s0 at all, in fact it is inspired from the One Instruction
|
|
300 Set Computer.
|
|
301 .Sp
|
|
302 The calculator has a number of memories (default 100 \- these can be changed
|
|
303 by appending a number to the operating mode, for example \fIoic10\fR will
|
|
304 use a 10\-memory calculator). These memories are identified by the letter
|
|
305 \&\fBm\fR followed by a number; in the default 100\-memory version, the first two
|
|
306 digits after \fBm\fR are the memory, and any subsequent digit forms part
|
|
307 of the next operand. At the start, all memories are initialised to 0.
|
|
308 .Sp
|
|
309 Since there is only one operation, there is no need to specify it, so an
|
|
310 \&\*(L"operation\*(R" is a sequence of three operands and a result. The result must
|
|
311 be a memory, while each operand can be a number or a memory, with the
|
|
312 limitation that consecutive numbers are acceptable only if the parser can
|
|
313 determine where one ends and the next one starts. So for example \*(L"1\-0\*(R" is
|
|
314 two numeric operands, 1 and \-0 (aka 0); \*(L"1.2.3\*(R" is also two operands,
|
|
315 1.2 and 3; \*(L"12\*(R" is a single operand, even if you intended it to be two
|
|
316 operands, 1 and 2, and even if you put spaces: \*(L"1 2\*(R" is still interpreted
|
|
317 as the single operand 12.
|
|
318 .Sp
|
|
319 The operation performed is the difference between the first two operands,
|
|
320 divided by the third. For example, the three operations:
|
|
321 .Sp
|
|
322 .Vb 3
|
|
323 \& 7 m01 2 M01
|
|
324 \& 1 m02 1 m02
|
|
325 \& m1 .5 m2 m03
|
|
326 .Ve
|
|
327 .Sp
|
|
328 will produce results m01=3.5 ((7\-0)/2); m02=1 ((1\-0)/1); m03=3 ((3.5\-.5)/1).
|
|
329 and will produce the following output if the calculator is running in batch
|
|
330 mode:
|
|
331 .Sp
|
|
332 .Vb 3
|
|
333 \& m01 3.5 (7 \- m01) / 2
|
|
334 \& m02 1 (1 \- m02) / 1
|
|
335 \& m03 3 (m01 \- .5) / m02
|
|
336 .Ve
|
|
337 .SH "SEE ALSO"
|
|
338 .IX Header "SEE ALSO"
|
|
339 The \s-1INTERCAL\s0 on-line documentation, by running \fBintercalc\fR and finding the
|
|
340 \&\*(L"help\*(R" menu or key (X and Curses) or backspark escape (Line and None).
|