evaluateTypedExpression

fun evaluateTypedExpression(expression: String, constants: (String) -> Any? = { null }, functions: TypedFunctionExtensions = TypedFunctionExtensions.EMPTY): Any?(source)

Evaluates a typed expression based on the provided string input, constants, and function definitions.

Return

The result of the evaluated expression as an Any? type. Returns null if the evaluation produces no result.

Parameters

expression

The string representation of the expression to evaluate.

constants

A lambda function providing constant values for specific variables. Returns null if a constant is not found. Defaults to a function returning null for any input.

functions

A TypedFunctionExtensions instance encapsulating function definitions for 0 to 5 arguments. Defaults to an empty set of functions.

Throws

If a syntax error occurs in the input expression or during expression evaluation.