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

Direct call operator.

Compiler translates f(args...) to f.invoke([args...]).

Parameters
ParameterDescription
argsArguments as Object array.
Returns

Result of type ReturnType.

Throws
  • Exception if invocation fails.
Example
import klyn.reflection

f = eval("def twice(x as Int): return x * 2")
if f is Invocable<Int>:
print(f(21))    # 42