Skip to content

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

Léela en español

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

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

set_delayed function

Define a function; also written f(x) := body.

How to write it

set_delayed(pattern, body)

pattern
The function with its parameters, such as f(x). Takes an expression.
body
What it computes, using the parameters. Takes an expression.

Examples

  • f(x):=x2+1;  f(3)  10\displaystyle f(x) := x^{2}+1;\; f(3) \; 10
    f(x) := x^2 + 1; f(3)

    In the solver, f(x) := x^2 + 1; f(3) gives 10.

    Open in the solver
  • set

    Assign a value to a name; also written name := value.

  • slot

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

  • subs_repeated

    Apply substitution rules again and again until nothing changes.

  • release_hold

    Evaluate an expression that was held.

  • subtract_from

    Subtract a value from a variable in place and return the new value.

  • pre_increment

    Add 1 to a variable in place and return the new value.