Running Rascal
rascal-0.34.0
Running Rascal: starting a terminal with a read-eval-print-loop
- On the Unix or Windows Commandline, start a Rascal Shell by:
java -jar rascal-<version>.jar
- In VScode, in the command palette type
Rascal
and selectCreate Rascal Terminal
- In Eclipse, from the button bar select the button with the Rascal logo.
- With Maven, Create New Project first and then type:
mvn rascal:console
You will be prompted for input right after the version is printed and a lot of information about the current searchpath configuration.
Exit the terminal REPL
Here we show how to quit the terminal:
:quit
Similarly you could type CTRL+D
which indicates end-of-file to terminate the process.
Now what?
More information about the features of the shell can be found here. At the prompt you can type Expressions, Statements and Declarations.
rascal>1 + 1
int: 2
rascal>myList = [ i | i <- [1..11], i % 2 == 0];
list[int]: [2,4,6,8,10]
rascal>import Prelude;
ok
rascal>println("Hello <myList> is <size(myList)> long");
Hello [2,4,6,8,10] is 5 long
ok
Next you could create a new Rascal project to start writing Rascal code.