summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-12-22 04:08:34 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-12-22 04:08:34 +0100
commitd0d6117176d68b2345d36e81ccdaa447e9caa724 (patch)
tree6cb8f3e4735a695be8c0922434df4c60f7cf82c7 /content/fate_v1/computations/cons
Moving to Hugo.
Diffstat (limited to 'content/fate_v1/computations/cons')
-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.