Skip to main content

Module lambda

Module lambda 

Source
Expand description

Lambdas, the function arguments of higher-order scalar functions such as list_transform.

A Lambda is a list of parameter names and a body that reads them with var. A function that takes a lambda keeps it in its options. When the function’s node is bound, it binds the lambda to its parameters’ dtypes, once, and keeps the BoundLambda instead.

Binding turns the lambda into an ordinary expression over a struct of its inputs, one field per parameter: @x becomes $.x. To run it, the function puts the parameters’ arrays in that struct, such as one row per list element, and applies the bound body to it. The body reads nothing but its parameters, so the function’s children are everything it reads.

Structs§

BoundLambda
A Lambda bound to its parameters’ dtypes, ready to run.
Lambda
Parameter names and a body: the function argument of a higher-order scalar function, as written.