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

Operator call - enables f(args) syntax.

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 square(x as Int) as Int:
               return x * x
           """) as Invocable<Int>
print(f(9))    # 81