compileFunction2OrNull
Attempts to compile a string expression into a lambda function with two parameters, returning null if an error occurs during compilation.
This function is a safe wrapper around compileFunction2
, catching any exceptions that may be thrown during the compilation process. If an error occurs, the provided onError
callback is invoked with the exception, and the function returns null.
Return
A lambda function that takes two parameters of types T0 and T1 and returns a result of type R if the compilation is successful. Returns null if an error occurs during compilation.
Parameters
The type of the first parameter.
The type of the second parameter.
The return type of the resulting lambda function.
The string expression to compile.
The name of the first parameter in the expression.
The name of the second parameter in the expression.
A lambda function that provides constant values for variables by name. Defaults to returning null for all names.
The custom functions available in the context of the expression. Defaults to an empty set of functions.
A callback invoked with the exception if an error occurs during compilation. Defaults to an empty function.