Your First Refal Plus Program

To maintain the historically established tradition, we begin by considering a simple program in Refal Plus.

This program consists of three directives:
$use StdIO;  // Import i/o functions from the module StdIO
$func Main = e;  // Declare the format of the main function:
                 // empty as input, anything as output.
Main             // Define the main function
    = <PrintLn "Hello!">; // Print a line
The first directive
    $use StdIO;
states that the program is going to use library input/output functions, which are to be imported from the module StdIO. The second directive declares the format of the function Main: what is what it can accept as input, and what it will produce as output. The third directive is the definition of the function Main, and, by convention, the execution of a Refal Plus program always begins by evaluating the call to the function Main.
The argument of the function Main must be empty. In the above program, the function Main calls the library function PrintLn with the argument "Hello!", thereby causing the character string
    Hello!
followed by the character "new line", to be sent to the standard output device. Then the execution of the program terminates.