summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'content/fate_v1/computations/cons/_index.md')
-rw-r--r--content/fate_v1/computations/cons/_index.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/content/fate_v1/computations/cons/_index.md b/content/fate_v1/computations/cons/_index.md
new file mode 100644
index 0000000..5ece27b
--- /dev/null
+++ b/content/fate_v1/computations/cons/_index.md
@@ -0,0 +1,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.