Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

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⁡(#12 &,[1,2,3])=[1,4,9]\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

Functions its examples use

  • map

    Apply a function to every element of a list.

  • function

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

  • 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.