executeAs

fun FunctionCall<*>.executeAs(function: Function<*>, arguments: List<FunctionCallArgument> = this.arguments): OutputValue<*>

Re-dispatches this call against a different function, reusing the original arguments, and executes it.

Useful when a wrapper function needs to delegate to another function while preserving the caller's arguments, as in the extend stdlib function.

Return

the output of executing function against this call's arguments

Parameters

function

function to re-dispatch the call to

arguments

optional new arguments to use instead of the original ones