At last, we have reached the project in which we can actually run our Calc programs.
To run it, enter the calc_interpreter folder, and type cargo run. After compilation, the following text will appear on the console:
* Calc interactive interpreter *
>
The first line is an introduction message, and the second one is a prompt. Now, we type the following as an example:
@a >a @b b := a + 2 <b
After you press Enter, this Calc program is executed. The a variable is declared, and when the input statement is executed, a question mark will appear on the console. Type 5 and press Enter.
The program goes on by declaring the b variable, assigning to it the value of the a + 2 expression, and then printing 7 as the value of b. Then, the program finishes, and the prompt reappears.
So, on the screen, there will be the following:
* Calc interactive interpreter *
> @a >a @b b := a + 2 <b
? 5
7
>
The interpreter, in addition, has some specific commands...