1. Getting started with MathPiper off-line


1.1 Introduction

This section describes how to get started with MathPiper locally by downloading and compiling the program. However, this is not strictly necessary. You can also go online to our web site and use MathPiper in there inside your browser. The web page contains tutorials, example calculations and lots of documentation. This document is only useful if you plan to build and install MathPiper yourself.


1.2 Installing MathPiper

Read the file INSTALL for instructions on how to compile MathPiper. MathPiper is portable across most Unix-ish platforms and requires only a standard C++ compiler such as g++.

The base MathPiper application accepts text as input and returns text as output. This makes it rather platform-independent. Apart from Unix-like systems, MathPiper has been compiled on Windows and on EPOC32, aka Psion (which doesn't come with a standard C++ library!). The source code to compile MathPiper for Windows can be found at the Sourceforge repository .

For Unix, compilation basically amounts to the standard sequence

./configure
make
make install
This will install the binaries to /usr/local/bin and the library files to /usr/local/share/mathpiper/.

Additionally, LaTeX-formatted documentation in PostScript and PDF formats can be produced by the command

make texdocs

or, alternatively, by passing --enable-ps-doc or --enable-pdf-doc to ./configure when building MathPiper. In the latter case, the documentation will be automatically rebuilt every time the documentation changes (which is useful when maintaining the documentation).

In addition, there is also a Java version of the lower-level interpreter. The code for this Java version can be found in the directory "JavaMathPiper", and can be compiled with the make file "makefile.mathpiper", by typing in:

make -f makefile.mathpiper

The interpreter can then be invoked from the command line with:

java -jar mathpiper.jar

or alternatively it can be invoked as an applet, by opening mathpiperconsole.html.

The binary files that comprise the entire binary release for the Java version are:

The Java version has almost all the features the C++ version has. In fact, there is no reason the Java version should not have all the same features. Not all command line arguments are available yet, and the command line prompt does not have the history yet.


1.3 Using the console mode

You can run MathPiper in the console mode simply by typing mathpiper. The MathPiper command prompt looks like this:
In>
and MathPiper's answers appear after the prompt
Out>

A MathPiper session may be terminated by typing Exit() or quit. Pressing ^C will also quit MathPiper; however, pressing ^C while MathPiper is busy with a calculation will stop just that calculation. A session can be restarted (forgetting all previous definitions and results) by typing
restart

Typically, you would enter one statement per line, for example

In> Sin(Pi/2);
Out> 1;

Statements should end with a semicolon (;) although this is not required in interactive sessions (MathPiper will append a semicolon at end of line to finish the statement).

Type Example(); to get some random examples of MathPiper calculations.

The command line has a history list, so it should be easy to browse through the expressions you entered previously using the Up and Down arrow keys.

When a few characters have been typed, the command line will use the characters before the cursor as a filter into the history, and allow you to browse through all the commands in the history that start with these characters quickly, instead of browsing through the entire history.

Typing the first few characters of a previous expression and then hitting the TAB key makes MathPiper recall the last expression in the history list that matches these first characters.

Commands spanning multiple lines can (and actually have to) be entered by using a trailing backslash \ at end of each continued line. For example:

In> a:=2+3+
Error on line 1 in file [CommandLine]
Line error occurred on:
>>>
Error parsing expression

In> a:=2+3+ \
In> 1
Out> 6;
The error after our first attempt occurred because MathPiper has appended a semicolon at end of the first line and 2+3+; is not a valid MathPiper expression.

Incidentally, any text MathPiper prints without a prompt is either messages printed by functions as their side-effect, or error messages. Resulting values of expressions are always printed after an Out> prompt.