### 6.3.12 Concatenating two lists or a list and an element

The concat or augment command combines to lists or adds an element to a list.

- concat takes two arguments: L1 and L2, two lists or a list and an element (in any order).
- concat(L1,L2) returns a list consisting of the elements of L1 (or L1 itself if it is not a list) followed by the elements of L2 (or L2 itself).

#### Examples

concat([3,4,2],[1,2,4])

or:

augment([3,4,2],[1,2,4])

| ⎡ ⎣ | 3,4,2,1,2,4 | ⎤ ⎦

concat([3,4,2],5)

or:

augment([3,4,2],5)

| ⎡ ⎣ | 3,4,2,5 | ⎤ ⎦

concat(2,[5,4,3])

or:

augment(2,[5,4,3])

| ⎡ ⎣ | 2,5,4,3 | ⎤ ⎦

concat([[3,4,2]],[[1,2,4]])

or:

augment([[3,4,2]],[[1,2,4]])

⎡ ⎣ |
3 | 4 | 2 | 1 | 2 | 4
| ⎤ ⎦