3  Concept

The new user interface of rcalc introduced in version 0.5.0 gives you access to some interesting possibilities to organize your calculus. Each valid expression you type is added to a list, where each row depends on all the previous ones.

3.1  Session

When you type a valid expression (Section 4) at the rcalc prompt, you modify your session by adding (or replacing) a row.

A typical session looks like this:

Figure 3-1  rcalc session

The first and third rows represent a function definition (f and g). The second row is a variable definition (a), and the fourth row is an evaluation (that is, you just ask for a result without storing it in a variable).

See Section 4 to learn how to add variables or functions.

In the session table, the first column shows the state of the line. It can be active or inactive. The session state results of the evaluation of all active lines, beginning with the first one, and descending to the last one.

3.2  Operations on lines

Since the lines are evaluated from the first one to the last one, the order has a consequence on all the lines below.

Once you have clicked on a row, you can move it up, down, (in)activate or remove it using the line toolbar.

Figure 3-2  Line toolbar

The insert mode button is used to define where the next expression will be inserted: at end, before or after the selected line, or replace the selected line.

Line operations are explained in Section 5.

3.3  (In)activate lines

If a line is active, it will be evaluated, thus it will influence all the lines below it. If it is inactive, it will just be ignored.

For example, let us inactivate the second line:

Figure 3-3  Inactivate a line

Regarding to the third and fourth lines, the variable 'a' no longer exists. Since they both depend on it, their value is now 'undefined'.

3.4  Replacing a line

You can also replace the row to modify the value of 'a':

Figure 3-4  Replacing a line

Notice how the values of all the lines below change.

3.5  Multiple variables or functions definitions

Now, what if instead of replacing the line, we define 'a' twice ? Since the order is important, the first definition will be used until the second one is reached.


Figure 3-5  Defining a variable twice

...and if we inactivate the second one, the first one is used:

Figure 3-6  Inactivating the second definition

You can define multiple functions as well.