# set function

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

## How to write it

### set(name, value)

**name**

The name to assign. Takes a variable.

**value**

The value. Takes an expression.

## Examples

- $\displaystyle a := 5;\; a+1 \; 6$

  `a := 5; a + 1`

  In the solver, `a := 5; a + 1` gives `6`.

  [Open in the solver](https://hilberon.com/?q=a%20%3A%3D%205%3B%20a%20%2B%201)

## Related functions

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

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

  Evaluate an expression that was held.
- [slot](https://hilberon.com/library/slot)

  The n-th argument of a function with no name: inside function(body), slot(1) is the first.
- [pre_increment](https://hilberon.com/library/pre_increment)

  Add 1 to a variable in place and return the new value.
- [subs_repeated](https://hilberon.com/library/subs_repeated)

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

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

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