# set 函数

给名称赋值；也可写作 name := value。

## 怎么写

### set(name, value)

**name**

要赋值的名称。接受一个变量。

**value**

值。接受一个表达式。

## 示例

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

  `a := 5; a + 1`

  在求解器中，`a := 5; a + 1` 的结果是 `6`。

  [在求解器中打开](https://zh.hilberon.com/?q=a%20%3A%3D%205%3B%20a%20%2B%201)

## 相关函数

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

  定义函数；也可写作 f(x) := body。
- [release_hold](https://zh.hilberon.com/library/release_hold)

  对已保持的表达式求值。
- [slot](https://zh.hilberon.com/library/slot)

  无名函数的第 n 个参数：在 function(body) 中，slot(1) 是第一个。
- [pre_increment](https://zh.hilberon.com/library/pre_increment)

  把变量原地加 1 并返回新值。
- [subs_repeated](https://zh.hilberon.com/library/subs_repeated)

  反复应用代入规则，直到不再变化。
- [pre_decrement](https://zh.hilberon.com/library/pre_decrement)

  将变量就地减 1，并返回新值。

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