blob: 1b60f514305a292424f1a7e8e0f90d492a43b805 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
<p>
Gleam has a shorthand syntax for creating anonymous functions that take one
argument and immediately call another function with that argument: the
function capture syntax.
</p>
<p>
The anonymous function <code>fn(a) { some_function(..., a, ...) }</code> can
be written as <code>some_function(..., _, ...)</code>, with any number of
other arguments passed to the inner function. The underscore <code>_</code> is
a placeholder for the argument, equivalent to <code>a</code> in
<code>fn(a) { some_function(..., a, ...) }</code>.
</p>
|