summaryrefslogtreecommitdiff
blob: 5ece27b0e1cdd47e852ad52fd7dd4598c4654930 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
---
title: Cons
---
Fate features a *construct* computation, making it possible to create an
anonymous structure by creating pairs of computations. Unlike collections, these
pairs do not have to be made of computations of the same type.

### PAIRING
{{< fatecode >}}(cons [C0 = COMPUTATION*] [C1 = COMPUTATION*]){{< /fatecode >}}

Returns the value corresponding to a pair made of `[C0]` and `[C1]`. Note that
the variable shorthand cannot be used for either parameter.

### RETRIEVING THE FIRST ITEM
{{< fatecode >}}(car [CONS]){{< /fatecode >}}

Returns the value corresponding to the first item in the `[CONS]` pair.

### RETRIEVING THE SECOND ITEM
{{< fatecode >}}(cdr [CONS]){{< /fatecode >}}

Returns the value corresponding to the second item in the `[CONS]` pair.