996
|
1 <HTML>
|
|
2 <HEAD>
|
|
3 <TITLE>CLC-INTERCAL Reference</TITLE>
|
|
4 </HEAD>
|
|
5 <BODY>
|
|
6 <H1>CLC-INTERCAL Reference</H1>
|
|
7 <H2>... The INTERCAL calculator</H2>
|
|
8
|
|
9 <P>
|
|
10 Table of contents:
|
|
11 <UL>
|
|
12 <LI><A HREF="index.html">Parent directory</A>
|
|
13 <LI><A HREF="#intercalc">The INTERCAL calculator</A>
|
|
14 <LI><A HREF="#command">Command-line options</A>
|
|
15 <LI><A HREF="#using">Using the calculator</A>
|
|
16 </UL>
|
|
17 </P>
|
|
18
|
|
19 <H2><A NAME="intercalc">The INTERCAL calculator</A></H2>
|
|
20 <P>
|
|
21 Starting from CLC-INTERCAL 1.-94.-4, a new INTERCAL calculator is
|
|
22 included with the distribution. Apart from the obvious use as a luxury
|
|
23 desk calculator, the calculator allows to quickly test fragments of
|
|
24 INTERCAL programs by just typing them in the calculator and seeing what
|
|
25 happens. Note that some statements are by necessity not supported,
|
|
26 for example COME FROMs have no real meaning as each statement is
|
|
27 executed as a separate program. ABSTAIN FROM and friends, however,
|
|
28 are supported: you can even say things line "DO ABSTAIN FROM (1)",
|
|
29 them write out the state to a file, exit the calculator, start it
|
|
30 up again, read the state back in, type "(1) DO .1 <- #2" and the
|
|
31 statement will not be executed: the calculator remembers it's supposed
|
|
32 to be ABSTAINed FROM.
|
|
33 </P>
|
|
34
|
|
35 <P>
|
|
36 <I>intercalc</I> requires CLC-INTERCAL 1.-94.-4 and newer. It won't work with
|
|
37 older versions.
|
|
38 </P>
|
|
39
|
|
40 <P>
|
|
41 Starting with CLC-INTERCAL 1.-94.-2, <I>intercalc</I> is provided as a
|
|
42 separate package, CLC-INTERCAL-ICALC. The various User Interfaces are
|
|
43 also probided as separate packages, so you can install just the ones
|
|
44 you use.
|
|
45 </P>
|
|
46
|
|
47 <P>
|
|
48 By default, if started without instructions to the contrary, <I>intercalc</I>
|
|
49 attempts to use the "best" user interface which happens to work in
|
|
50 the current environment; here "best" means that the list of
|
|
51 interfaces is obtained from file <I>.sickrc</I> or <I>system.sickrc</I>
|
|
52 and the first one which works is used. The default is <I>X</I>,
|
|
53 <I>Curses</I>, <I>Line</I>, <I>None</I> meaning that a GTK2-based graphical
|
|
54 interface is preferred if X is running and GTK2 is installed; otherwise,
|
|
55 a curses-based text interface or a ReadLine-based interface if the
|
|
56 calculator is running on a terminal and the necessary libraries are installed.
|
|
57 If none of them work, a batch mode interface which writes commands in from standard
|
|
58 input and produces results on standard output always works. In the
|
|
59 remainder of this chapter, we speak of "interactive" interface to
|
|
60 mean "anything except batch mode" and of "windowed"
|
|
61 interface to mean X or Curses, as opposed to Line or None.
|
|
62 </P>
|
|
63
|
|
64 <P>
|
|
65 The arguments on the command line are either options (in the form
|
|
66 <I>--name</I><CODE>=</CODE><I>value</I> or <I>-xvalue</I>), or filenames.
|
|
67 If a filename is encountered, it must be a file previously created by
|
|
68 <I>intercalc</I> using the Write Out option. Specifiying a file is
|
|
69 equivalent to selecting Read In first thing after the calculator starts up.
|
|
70 </P>
|
|
71
|
|
72 <H2><A NAME="command">Command-line options</A></H2>
|
|
73 <P>
|
|
74 There is a number of command-line options, which are grouped
|
|
75 by type for easy reference.
|
|
76 </P>
|
|
77
|
|
78 <H3>User interface options</H3>
|
|
79
|
|
80 <P>
|
|
81 If the automatic user interface selection does not give the required
|
|
82 result, the following options can be used to control what happens:
|
|
83 </P>
|
|
84
|
|
85 <TABLE>
|
|
86 <TR><TH>Long option</TH><TH>Short</TH><TH>Meaning</TH></TR>
|
|
87 <TR><TD>--graphic</TD><TD>-X</TD><TD>GTK2-based graphical interface</TD></TR>
|
|
88 <TR><TD>--curses</TD><TD>-c</TD><TD>Curses-based text interface</TD></TR>
|
|
89 <TR><TD>--line</TD><TD></TD><TD>ReadLine-based text interface</TD></TR>
|
|
90 <TR><TD>--batch</TD><TD></TD><TD>Batch mode, no user interface</TD></TR>
|
|
91 <TR><TD>--interface=<I>NAME</I></TD><TD>-i<I>NAME</I></TD><TD>Load the specified interface</TD></TR>
|
|
92 </TABLE>
|
|
93
|
|
94 <H3>Compiler options and operating mode</H3>
|
|
95
|
|
96 <P>
|
|
97 These are either the name of the compiler to use, and any extensions
|
|
98 which you wish to load initially, or other options which control how
|
|
99 the compiler behaves.
|
|
100 </P>
|
|
101
|
|
102 <TABLE>
|
|
103 <TR><TH>Long option</TH><TH>Short</TH><TH>Meaning</TH></TR>
|
|
104 <TR><TD>--include=<I>DIR</I></TD><TD>-I<I>DIR</I></TD><TD>Add directory to search path for compiler objects</TD></TR>
|
|
105 <TR><TD>--language=<I>NAME</I></TD><TD>-l<I>NAME</I></TD><TD>Selects the compiler (default: sick)</TD></TR>
|
|
106 <TR><TD>--option=<I>NAME</I></TD><TD>-o<I>NAME</I></TD><TD>Selects a compiler option, may be repeated (default: none)</TD></TR>
|
|
107 <TR><TD>--mode=<I>NAME</I></TD><TD>-m<I>NAME</I></TD><TD>Selects operating mode (default: full)</TD></TR>
|
|
108 <TR><TD>--bug=<I>NUMBER</I></TD><TD></TD><TD>Change the probability of the compiler bug</TD></TR>
|
|
109 <TR><TD>--ubug=<I>NUMBER</I></TD><TD></TD><TD>Change the probability of the unexplainable compiler bug</TD></TR>
|
|
110 </TABLE>
|
|
111
|
|
112 <P>
|
|
113 The calculator currently defines three operating modes: <I>full</I> (the default), <I>expr</I> and <I>oic</I>.
|
|
114 </P>
|
|
115
|
|
116 <P>
|
|
117 In <I>full</I> mode, the full power of the selected compiler and extensions is available. One types
|
|
118 INTERCAL statements and watches them execute. Additionally, for convenience, one can type an
|
|
119 expression and this will be evaluated and its result displayed. It is internally implemented by
|
|
120 pretending you typed "DO READ OUT <I>expression</I>".
|
|
121 </P>
|
|
122
|
|
123 <P>
|
|
124 <I>expr</I> mode is a restricted form of full mode, where you can only execute assignments and evaluate
|
|
125 expressions; other statements are disallowed. Assignments are specified without the initial DO and/or PLEASE.
|
|
126 Expressions can of course contain overloading and other side-effects, which will be remembered and will
|
|
127 come back to cause unexpected results later. This mode is suitable for a desk calculator.
|
|
128 </P>
|
|
129
|
|
130 <P>
|
|
131 <I>oic</I> mode is a silly "One Instruction" desk calculator which is there because we can.
|
|
132 This mode is currently undocumented.
|
|
133 </P>
|
|
134
|
|
135 <H3>Misc options</H3>
|
|
136
|
|
137 <P>
|
|
138 The following options control the way <I>intercalc</I> operates:
|
|
139 </P>
|
|
140
|
|
141 <TABLE>
|
|
142 <TR><TH>Long option</TH><TH>Short</TH><TH>Meaning</TH></TR>
|
|
143 <TR><TD>--nouserrc</TD><TD></TD><TD>Ignore <I>.sickrc</I> files, use only first <I>system.sickrc</I> found</TD></TR>
|
|
144 <TR><TD>--rcfile=<I>NAME</I></TD><TD>-r<I>NAME</I></TD><TD>Uses specified file instead of searching for <I>.sickrc</I> and <I>system.sickrc</I></TD></TR>
|
|
145 </TABLE>
|
|
146
|
|
147 <H2><A NAME="using">Using the calculator</A></H2>
|
|
148
|
|
149 <P>
|
|
150 Once the calculator has started, it will display its window (in windowed
|
|
151 mode), print its prompt (in Line mode), or simply wait for input (in
|
|
152 batch mode). In any case, you enter statements or expressions and
|
|
153 watch them execute.
|
|
154 </P>
|
|
155
|
|
156 <P>
|
|
157 Some menus are available in windowed mode to change the current compiler,
|
|
158 base and operating mode. These should be self-explanatory in the X
|
|
159 interface. In the Curses interface, press Alt-F to access the File menu,
|
|
160 Alt-E to access the Edit menu, and so on with the other menus. Just
|
|
161 use Alt and the initial letter of the menu name. Once a menu is open,
|
|
162 the up and down arrow keys navigate the menu, while the left and right
|
|
163 keys move to the next menu in the corresponding direction. To select
|
|
164 a menu entry, press Enter; to close the menu without making a selection,
|
|
165 press Esc.
|
|
166 </P>
|
|
167
|
|
168 <P>
|
|
169 In X mode you can provide input by clicking on a key or by pressing the
|
|
170 corresponding key on the keyboard if there is one (some symbols may not
|
|
171 be available on all keyboards); in Curses mode you can press the key
|
|
172 or, if necesssary, use the cursor keys (up, down, left, right) to highlight
|
|
173 one of the buttons on the screen, then press Enter to activate it.
|
|
174 </P>
|
|
175
|
|
176 <P>
|
|
177 In line and batch mode, access to menu functions can be achieved by starting
|
|
178 a line with a backspark (<CODE>`</CODE>) and a letter. In Line mode you can
|
|
179 see what letters make sense by pressing Tab after the backspark, which will
|
|
180 give you a list. In any case, the following backsparks are available:
|
|
181 </P>
|
|
182
|
|
183 <TABLE>
|
|
184 <TR><TH>Backspark</TH><TH>Meaning</TH></TR>
|
|
185 <TR><TD>`a</TD><TD>Show the "About intercalc" text</TD></TR>
|
|
186 <TR><TD>`b<I>BASE</I></TD><TD>Change base</TD></TR>
|
|
187 <TR><TD>`c</TD><TD>Save settings to <I>.sickrc</I> (not yet implemented)</TD></TR>
|
|
188 <TR><TD>`g</TD><TD>Give up (exit calculator) - you'll need to do it twice to confirm</TD></TR>
|
|
189 <TR><TD>`h</TD><TD>Show command history</TD></TR>
|
|
190 <TR><TD>`h<I>NUM</I></TD><TD>Show command history, limiting to last <I>NUM</I> commands</TD></TR>
|
|
191 <TR><TD>`l<I>LANGUAGE</I></TD><TD>Load a different compiler (1972, ick or sick)</TD></TR>
|
|
192 <TR><TD>`m<I>MODE</I></TD><TD>Change operating mode (full, expr or oic)</TD></TR>
|
|
193 <TR><TD>`o<I>OPTION</I></TD><TD>Toggle compiler option</TD></TR>
|
|
194 <TR><TD>`r<I>FILE</I></TD><TD>Read Out: saves calculator state to file</TD></TR>
|
|
195 <TR><TD>`r</TD><TD>Like `r<I>FILE</I> but uses last filename given to `r or `w</TD></TR>
|
|
196 <TR><TD>`t</TD><TD>Show program trace, if enabled with `otrace</TD></TR>
|
|
197 <TR><TD>`t<I>NUM</I></TD><TD>Same as `t, limiting to trace produced by last <I>NUM</I> commands</TD></TR>
|
|
198 <TR><TD>`w<I>FILE</I></TD><TD>Write In: loads calculator state from file</TD></TR>
|
|
199 <TR><TD>`?</TD><TD>Help: displays the help text</TD></TR>
|
|
200 </TABLE>
|
|
201
|
|
202 <P>
|
|
203 If you do not provide an argument to `b, `l, `m or `o, they will show
|
|
204 a list. Currently selected base, language, mode or options (respectively)
|
|
205 will be marked with a splat.
|
|
206 </P>
|
|
207
|
|
208 </BODY>
|
|
209 </HTML>
|
|
210
|