Function Values
Function values are those that when invoked with a set of input values (i.e., arguments) produce a new value.
Structure
In M, functions are specified by listing the input parameters of the function in parentheses, then the “goes to” operator =>, then the expression that defines the function.
Examples
Concatenator = (parameter1, parameter2) => (parameter1 & parameter2)
DifferentDistinct = (x) => List.Difference(x,List.Distinct(x))
Special Considerations
- Flexibility and Power – Functions can be assigned to variables, passed as arguments, and returned from other functions, making them some of the most versatile and powerful kinds of values in M.
- Importance...