compileFunction1
fun <T0, R> compileFunction1(expression: String, parameter0: String, constants: (String) -> Any? = { null }, functions: TypedFunctionExtensions = TypedFunctionExtensions.EMPTY): (T0) -> R(source)
Compiles a string expression into a single-parameter function capable of evaluating the expression.
Return
A single-parameter function that takes an argument of type T0 and evaluates the expression to return a result of type R.
Parameters
T0
The type of the single parameter that will be passed to the compiled function.
R
The return type of the compiled function.
expression
The string representation of the expression to be compiled.
parameter0
The name of the required parameter in the expression.
constants
A lambda function to resolve constants in the expression by their names. Defaults to a function returning null for all names.
functions
A set of function extensions that can be used within the expression. Defaults to an empty set.