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
map(function(slot(1)^2), [1, 2, 3])In the solver,
Open in the solvermap(function(slot(1)^2), [1, 2, 3])gives[1, 4, 9].
Functions its examples use
Related functions
- subs_repeated
Apply substitution rules again and again until nothing changes.
- set_delayed
Define a function; also written f(x) := body.
- subtract_from
Subtract a value from a variable in place and return the new value.
- set
Assign a value to a name; also written name := value.
- times_by
Multiply a variable by a value in place and return the new value.
- release_hold
Evaluate an expression that was held.