aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter1_functions/lesson05_function_captures/en.html
blob: afa87a3b6d16fd2ec3f114faa2b29e3c1e6ab9b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
<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 final argument.
</p>