Getting started with Yacas off-line

# 1. Getting started with Yacas off-line

##

1.1 Introduction

This section describes how to get started with `Yacas` locally by downloading and compiling the program. However, this is not strictly necessary. You can also go online to our web site and use `Yacas` 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 `Yacas` yourself.

##

1.2 Installing `Yacas`

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

The base `Yacas` application accepts text as input and returns text as output. This makes it rather platform-independent. Apart from Unix-like systems, `Yacas` has been compiled on Windows and on EPOC32, aka Psion (which doesn't come with a standard C++ library!). The source code to compile `Yacas` 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/yacas/`.

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 `Yacas`. 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 "JavaYacas", and can be compiled with the make file "makefile.yacas", by typing in:

    make -f makefile.yacas

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

    java -jar yacas.jar

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

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

- yacas.jar - the Java class files in one jar file.
- yacasconsole.html - the file that launches the applet.
- hints.txt - the hints that are shown in the applet (the grey box with commands that match what you are typing in at that moment).

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 `Yacas` in the console mode simply by typing `yacas`. The `Yacas` command prompt looks like this:

    In>

and `Yacas`'s answers appear after the prompt

    Out>

A `Yacas` session may be terminated by typing `Exit()` or `quit`. Pressing `^``C` will also quit `Yacas`; however, pressing `^``C` while `Yacas` 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 (`Yacas` will append a semicolon at end of line to finish the statement).

Type `Example();` to get some random examples of `Yacas` 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 `Yacas` 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 `Yacas` has appended a semicolon at end of the first line and `2+3+;` is not a valid `Yacas` expression.

Incidentally, any text `Yacas` 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.