klyn.reflection.EvalFunctionWrapper.invoke
method
public invoke(args as Object[]) as ReturnType throws Exception:
Description

Invokes the function with dynamic arguments.

Parameters
ParameterDescription
argsArguments packaged as Object[].
Returns

Result cast to ReturnType.

Throws
  • Exception if argument binding fails or the invoked constructor, method, or function throws an exception.
Example
import klyn.reflection

f = eval("""def add(a as Int, b as Int) as Int:
return a + b""") as Invocable<Int>
print(f.invoke([10, 20]))    # 30