Function

Defines a function with the specified parameters and return value. Functions can also be recursive (see example below).

Syntax

function ([parameter1] [parameter2] …) 
   [result]
parameter1-N
One or more parameters separated by spaces.
result
The result of the function.

Example

The code below defines the factorial function recursively in a global named Factorial.

function (n)
   if
      ·  <=
            ·  n
            ·  1
      ·  1
      ·  *
            ·  n
            ·  Factorial
                  ·  -
                        ·  n
                        ·  1