Functions

Functions are defined using the def keyword. While every function in Marigold is technically unary, the compiler will automatically curry your arguments, essentially creating functions of any arity.

Functions always return the last value of the function. While this typically refers to the last line of the function, if statements and pipelines also act as return values.

Usage

def [function_name]([comma seperated arguments]) { [multiline expression] }

Example

See also