compileFunction3OrNull

fun <T0, T1, T2, R> compileFunction3OrNull(expression: String, parameter0: String, parameter1: String, parameter2: String, constants: (String) -> Any? = { null }, functions: TypedFunctionExtensions = TypedFunctionExtensions.EMPTY, onError: (Throwable) -> Unit = { }): (T0, T1, T2) -> R?(source)

Compiles a 3-parameter function from a given string expression, returning null if an error occurs during compilation.

Return

A lambda function that takes three parameters of types T0, T1, and T2, and returns a result of type R after evaluating the compiled expression, or null if an error occurs .

Parameters

T0

The type of the first parameter.

T1

The type of the second parameter.

T2

The type of the third parameter.

R

The return type of the compiled function.

expression

The string representation of the expression to be compiled.

parameter0

The name of the first parameter referenced in the expression.

parameter1

The name of the second parameter referenced in the expression.

parameter2

The name of the third parameter referenced in the expression.

constants

A lambda function providing constant values for variable names used in the expression. Defaults to a function returning null.

functions

An optional container of external functions that can be called within the expression. Defaults to an empty set of functions.

onError

A lambda function that will be invoked with the exception if an error occurs during compilation. Defaults to an empty function.