From C++ to HERCs Prolog: S-Expressions everywhere

This is an M-Expression:

write ("Hello World\n");

.... and this is an S-Expression:

{1, 2, 3}

M-Expression begins with a symbol and is followed by something in brackets. S-Expression is basically something enclosed by brackets. It is easy to transform an M-Expression into an S-Expression. Just move the symbols from the begining inside the bracket. Therefore this would be the S-Expression equivalent:

(write "Hello World\n");

Let's consider definition of a function. In general it consists of signature (function name and parameters) and body (instructions). In the majority of languages such functions are written using M-Expression. An example below:

myFunction (.....)
{
    call_1 (......);
    call_2 (......);
    call_3 (......);
    call_4 (......);
}


In this case we have to deal with BOTH signature AND body. Such as below:

{(myFunction .....)
    (call_1 ......);
    (call_2 ......);
    (call_3 ......);
    (call_4 ......);
}


As you can see, changing M-Expressions into S-Expression is a relatively easy task. It only requires moving brackets outside.

.... but why?

In many languages S-Expressions are used to write data structures, such as tables or records, while M-Expressions are used to write instructions and define functions, procedures or methods. Most of the dialects of Prolog also use M-Expressions. However, the division between data and instructions in Prolog can sometimes be very fluid. Instructions can became data and therefore they can be manipulated just like any other data. Data can suddently become instructions and be executed as any other instructions. Therefore it seems to be a good idea to use one and universal notation, such as S-Expressions.