invokeDynamic

fun invokeDynamic(arguments: List<Value<*>>, callingContext: Context? = null, allowDestructuring: Boolean = true): OutputValue<*>

Invokes the lambda action with given arguments.

Return

the result of the lambda action, as an undetermined, thus dynamically-typed, value

Parameters

arguments

arguments of the lambda action

callingContext

optional context of the call site that triggered this lambda invocation. When provided, its own libraries (e.g. lambda parameters, local variables) are propagated to the forked execution context, allowing body arguments containing dynamic references to resolve variables from the calling scope.

allowDestructuring

if true, arguments has only 1 element which is Destructurable, and the lambda has N>1 explicit parameters, the argument is destructured into N parts. For example, a dictionary may be destructured into its key and value.


fun invokeDynamic(vararg arguments: Value<*>): OutputValue<*>

See also