compileTypedExpression

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

Compiles a typed expression and returns a lambda that can execute the compiled expression.

Return

A lambda function that evaluates the compiled expression and returns its result.

Parameters

expression

The string representation of the expression to compile.

constants

A lambda function to resolve constants by their names. Defaults to a resolver that returns null.

functions

An instance of TypedFunctionExtensions containing the supported custom functions for the expression. Defaults to an empty set of functions.

Throws

If there is a syntax error or a parsing issue in the provided expression.