AlgorithmicFunction constructor

AlgorithmicFunction(
  1. String name,
  2. List<Expression> args,
  3. Function handler
)

Creates a generic function with variable number of arguments.

For example, to create a function that returns the minimum value in a given list of arguments:

args = [ Number(2), Number(1), Number(100) ]
handler = (List<double> args) => args.reduce(math.min)
f = AlgorithmicFunction('my_min', args, handler);

The name of the function has no functional impact, and is only used in the string representation. If the function is defined via the Parser#addFunction method instead it is supported by the parser.

Implementation

AlgorithmicFunction(super.name, super.args, this.handler) : super._any();