Function(<O>,<I0,>,<I1,>...<In>)
is the type of all functions that take inputs of types <I0,>,<I1,>...<In> and return values of type <O>. For example, the type of
string function example(string seed,int a)
{
return "{seed}_{a}";
}
is
Function(string,string,int)One common use of function types is forward declarations:
var Function(int,int) factorial;
int function factorial(int n)
{
if (n <= 1) return 1;
return n * factorial(n-1);
}
Fabl functions are first-class objects which can be passed as arguments to other functions, and can appear as the values of properties. Details appear in a later section.