Skip to content

Start an evaluation

Adrian Palacios edited this page Jul 18, 2017 · 8 revisions

Load file

The first step to start an evaluation is to load an Erlang file (*.erl).
To do this, select the "File" item from the menu bar, then select "Open":

Open file

This will open a file dialog where you can select the Erlang file to load.

Once you select the file, the application will try to compile the Erlang code to Core Erlang:

  • If the compilation is successful, it will show the Core Erlang code in the Code tab.
  • Otherwise, it will show a message error in the status bar (i.e., the bottom bar).

For instance, loading the file factorial.erl from the examples folder will show the associated Core Erlang code as in the following screenshot:

Load factorial

Start evaluation

To start an evaluation, you have to:

  • Choose a function from the "Funs" choice box.
  • Write the input arguments for the function application.
  • Push the START button.

The arguments must be written as Erlang terms, and they must separated by commas (as in a regular list of arguments). The following arguments are examples of valid input arguments:

  • Atoms: hello, 'Adrian', ...
  • Numbers: 1, 42, ...
  • Tuples: {hello, 42}, ...
  • Lists: [1,2,3], ...

Let's go back to the factorial example, and assume we have successfully loaded its code.
Now, we choose the function fact/1 and we write 42 as the input argument.

Input factorial

When we push the START button, the application will switch to the State tab and show a system composed of:

  • An empty global mailbox
  • A process evaluating the function application that we specified.

Start factorial

This means that we've started an evaluation. Congratulations! 👏👏👏

Clone this wiki locally