intercalc is a simple desk calculator, allowing the user to enter INTERCAL statements (to see what they
do) and expressions (to see what value they produce); it uses an interpreter object from CLC-INTERCAL to
provide immediate feedback.
The desk calculator accepts several options, some of which are documented here.
UserInterfaceOptions-X / --graphic
Enters X-based graphical user interface. Requires Perl-GTK. This is the default if Perl-GTK is
installed, the environment variable $DISPLAY is set and the opening of the X display succeeds.
-c / --curses
Enters full screen, curses-based interface. This is the default if the X based interface cannot be
started, the environment variable $TERM is set and the terminal name is known.
--line
Enters the line-mode user interface. This is the default if the X based and the curses based
interfaces do not work.
In this mode, the program executes each line from standard input according to the current mode and
language, and prints results to standard output. A line starting with a backspark is interpreted as
a command to the calculator. Use backspark-g to GIVE UP (you'll need to do it twice), or backspark-h
to display the ehm, help page. Things which are available via menu entries on the Curses and X
interfaces are also available via the backspark. For now, you can refer to the source code for a
list.
Command-line editing and command history is provided by the readline library. Command completion
works if the underlying compiler supports it (the compilers provided with the distributions do).
--batch
Avoids entering interactive mode. This is the default if the standard input and output are not
connected to a terminal and the X based interface cannot be started. This mode is very similar to the
line mode except that command-line editing and command history are not implemented. Backspark escapes
work just the same.
-itype / --interface=type
Selects the user interface type. Currently, only X, Curses, Line and None are defined, but more can
be installed as compiler plug-ins. If the interface selected is None, intercalc will work in batch
mode. In addition, an empty string will reinstate the default behaviour.
Sourcelanguageandcompilationoptions--bug=number
Selects a different probability for the compiler bug. The compiler bug is implemented by initialising
the compiler's state with the required probability: when a statement is compiled (usually at
runtime), a "BUG" instruction is emitted with the required probability. The default is 1%.
--ubug=number
Selects a probability for the unexplainable compiler bug. This is the compiler bug which occurs when
the probability of a (explainable) compiler bug is zero. Only wimps would use this option. The
default is 0.01%.
-Ipath / --include=path
Adds a directory before the standard search path for compiler objects and source code. If a file is
accessible from the current directory, it is never searched in any include path.
If this option is repeated, the given paths will be searched in the order given, followed by the
standard paths.
-llanguage / --language=language
Selects the language to use when interpreting user input. This should correspond to the name of a
compiler, which is an INTERCAL object which was originally built by iacc. Only the expression and
statement parsers are used, so it is possible to test incomplete compilers by loading them into
intercalc even if they don't work with sick. The default is obtained from the sickrc option
.INTERCALC.LANGUAGE.
--ooption ---option=option
Adds a language option. For example, --o3 selects base 3 calculation, and --owimp selects wimp mode.
If no options are provided, and the default language was taken from the sickrc file, the default
options are taken from the sickrc file. Note that if an option or a language is specified on the
command line, the sickrc defaults are ignored.
Unlike previous versions of intercalc, this version checks that the options make sense in the context
of the calculator; for example trying to load a compiler as an option will cause an error, but a
compiler extension will be OK.
-mmode / --mode=mode
Select operation mode. Currently, the only valid modes are full, expr and one. See "Operating Modes".
If this is not specified, the default is taken from the sickrc option ..INTERCALC.MODE.
--interpreter=module
Uses an alternative CLC-INTERCAL Interpreter; the selected Interpreter must provide methods to access
its internal state so that the calculator can display results. The default is whichever compatible
Interpreter is considered the best at the time the program is distributed.
MiscOptions-rname / --rcfile=name
Executes commands from file name before starting to accept input. This option can be repeated, to
execute more than one file. If it is not specified, the standard library, the current directory, and
the current user's home directory are searched for files with name system.sickrc or .sickrc, which
are then executed. The order for this search is: specified library (--include), system library, home
directory, current directory. This is different from the search order used when looking for objects
or source code. If a directory contains both .sickrc and system.sickrc, the system.sickrc is executed
first, followed by .sickrc. Also note that if the current directory or the home directory appear in
the search path and contain one of these files, they will be executed twice.
If filenames are explicitly specified, they must be fully qualified: the search path is not used to
find them.
--nouserrc
Prevents loading a user rcfile (.sickrc); also limits loading of system.sickrc to the first one
found. This option is normally only used when testing the installation, to prevent interference from
previous versions of CLC-INTERCAL.
--nosystemrc
Prevents loading system rcfiles (usually in /etc/sick) if any exist. This option is normally only
used during installation, to prevent interference from previous versions of CLC-INTERCAL.
-Rverb / ---rcskip=verb
Makes the program ignore the verb in a sickrc file.