Postfix.Simple (postfix v1.0.333)
Evaluator of terms using postfix notation
Link to this section Summary
Functions
Evaluate a list of values and functions
Link to this section Functions
Link to this function
eval(terms)
Evaluate a list of values and functions
iex> Postfix.Simple.eval([2, 3, &*/2, 4, &+/2])
{:ok, 10}
iex> Postfix.Simple.eval([1, 2, &-/2])
{:ok, -1}
Operands are given to the function in the natural left-to-right order. All operands are consumed by the function - the arity is not checked.