Lambda

open class Lambda(val parentContext: Context, val explicitParameters: List<LambdaParameter> = emptyList(), val action: (List<Value<*>>, Context) -> OutputValue<*>)

An action block with a variable parameter count. The return type is dynamic (a snippet of raw Quarkdown code is returned), hence it is evaluated and converted to a static type.

Parameters

parentContext

context this lambda lies in

explicitParameters

named parameters of the lambda. If not present, parameter names are automatically set to .1, .2, etc.

action

action to perform, which takes a variable sequence of Values and this lambda's own forked context as arguments and returns the output of the lambda.

Constructors

Link copied to clipboard
constructor(parentContext: Context, explicitParameters: List<LambdaParameter> = emptyList(), action: (List<Value<*>>, Context) -> OutputValue<*>)

Properties

Link copied to clipboard
val action: (List<Value<*>>, Context) -> OutputValue<*>
Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T, V : Value<T>> invoke(vararg values: Value<*>): V

Invokes the lambda action with given arguments and converts it to a static type.

Link copied to clipboard
fun invokeDynamic(vararg arguments: Value<*>): OutputValue<*>

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

Invokes the lambda action with given arguments.