### The Maxima on-line user's manual

Algebra Calculator

#### Assoc

Function: assoc (<key>, <list>, <default>)

Function: assoc (<key>, <list>) This function searches for the <key> in the left hand side of the input <list> of the form `[x,y,z,...]` where each of the <list> elements is an expression of a binary operand and 2 elements. For example `x=1`, `2^3`, `[a,b]` etc. The <key> is checked againts the first operand. `assoc` returns the second operand if the `key` is found. If the `key` is not found it either returns the <default> value. <default> is optional and defaults to `false`.

There are also some inexact matches for `assoc`. Try `?? assoc` to see them.

```(%o1)                                true
(%i2) ```

### Related Examples

##### assoc-makelist

makelist(assoc(is(i=1...

Calculate

##### assoc

assoc(3,[[1, 0001], [...

Calculate

##### assoc

assoc(C,[[A,15],[B,11...

Calculate

##### assoc

assoc(3,[[1, 0001], [...

Calculate

##### assoc

assoc(B,[[0, 0],[1,1]...

Calculate

##### assoc-makelist

makelist(assoc(is(i=2...

Calculate

##### assoc

log2(x) := log(x) / l...

log3(x) := log(x) / l...

hz: rand([log2(-x), l...

Calculate

##### assoc

assoc(C,[[A,15],[B,11...

Calculate

##### assoc

assoc(true,[[true, 1]...

Calculate

##### assoc

log2(x) := log(x) / l...

log3(x) := log(x) / l...

hz: rand([log2(x), lo...

Calculate