# slot function

The n-th argument of a function with no name: inside function(body), slot(1) is the first.

## How to write it

### slot(n)

The derivative sin' is written function(cos(slot(1))).

**n**

Which argument, from 1. Takes a whole number.

## Examples

- $\displaystyle \operatorname{map}(\#1^{2} \, \&, \left[ 1, 2, 3 \right]) = \left[ 1, 4, 9 \right]$

  `map(function(slot(1)^2), [1, 2, 3])`

  In the solver, `map(function(slot(1)^2), [1, 2, 3])` gives `[1, 4, 9]`.

  [Open in the solver](https://hilberon.com/?q=map%28function%28slot%281%29%5E2%29%2C%20%5B1%2C%202%2C%203%5D%29)

## Functions its examples use

- [map](https://hilberon.com/library/map)

  Apply a function to every element of a list.
- [function](https://hilberon.com/library/function)

  A function with no name; also written x => body.

## Related functions

- [subs_repeated](https://hilberon.com/library/subs_repeated)

  Apply substitution rules again and again until nothing changes.
- [set_delayed](https://hilberon.com/library/set_delayed)

  Define a function; also written f(x) := body.
- [subtract_from](https://hilberon.com/library/subtract_from)

  Subtract a value from a variable in place and return the new value.
- [set](https://hilberon.com/library/set)

  Assign a value to a name; also written name := value.
- [times_by](https://hilberon.com/library/times_by)

  Multiply a variable by a value in place and return the new value.
- [release_hold](https://hilberon.com/library/release_hold)

  Evaluate an expression that was held.

---
Source: https://hilberon.com/library/slot
