The advantage of noise functions over noise expressions is that they have parameters.
parameters | :: array[string] | The order of the parameters matters because functions can also be called with positional arguments. [...] |
The order of the parameters matters because functions can also be called with positional arguments. [...] | ||
expression | :: NoiseExpression | |
local_expressions optional | :: dictionary[string → NoiseExpression] | A map of expression name to expression. [...] |
A map of expression name to expression. [...] | ||
local_functions optional | :: dictionary[string → NoiseFunction] | A map of function name to function. [...] |
A map of function name to function. [...] |
expression | :: NoiseExpression | |
parameters | :: array[string] | The order of the parameters matters because functions can also be called with positional arguments. [...] |
The order of the parameters matters because functions can also be called with positional arguments. [...] | ||
local_expressions optional | :: dictionary[string → NoiseExpression] | A map of expression name to expression. [...] |
A map of expression name to expression. [...] | ||
local_functions optional | :: dictionary[string → NoiseFunction] | A map of function name to function. [...] |
A map of function name to function. [...] |
The order of the parameters matters because functions can also be called with positional arguments.
A function can't have more than 255 parameters.
A map of expression name to expression.
Local expressions are meant to store data locally similar to local variables in Lua. Their purpose is to hold noise expressions used multiple times in the named noise expression, or just to tell the reader that the local expression has a specific purpose. Local expressions can access other local definitions and also function parameters, but recursive definitions aren't supported.
A map of function name to function.
Local functions serve the same purpose as local expressions - they aren't visible outside of the specific prototype and they have access to other local definitions.