8 ms·
A thunk is just a function with no arguments representing a computation. In C++: int a=1, b=2; auto thunk = [=]() { return a+b; }
by gct 2y ago
A thunk is just a function with no arguments representing a computation. In C++:
int a=1, b=2; auto thunk = [=]() { return a+b; }
- pmarreck 2y agoso a deferred evaluation, like (in elixir) wrapping a computation in an fn (lambda of 0 arity)