summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-12-22 23:34:09 +0100
committerNathanael Sensfelder <SpamShield0@MultiAgentSystems.org>2020-12-22 23:34:09 +0100
commit7272d83113545ec46b35ea440811dfc7da7634e1 (patch)
tree40642cdafdf859c63e0c8e3b6d02d3e4ba8eabf7 /content/fate_v1/instructions/collections/_index.md
parent563f9cab92c48a2bd003c10248f21007e5ff64e6 (diff)
...
Diffstat (limited to 'content/fate_v1/instructions/collections/_index.md')
-rw-r--r--content/fate_v1/instructions/collections/_index.md21
1 files changed, 11 insertions, 10 deletions
diff --git a/content/fate_v1/instructions/collections/_index.md b/content/fate_v1/instructions/collections/_index.md
index 8d646ee..41de4f8 100644
--- a/content/fate_v1/instructions/collections/_index.md
+++ b/content/fate_v1/instructions/collections/_index.md
@@ -6,11 +6,12 @@ lists; and `[SET]`, which are ordered lists, but only useable with
`[COMPARABLE]` elements.
### ADDING A MEMBER
-{{< fatecode >}}(add_element! [COMPUTATION*] [COLLECTION VAR]){{< /fatecode >}}
+{{< fatecode >}}(add_element! [C0 = COMPUTATION*] ... [CN = COMPUTATION*] [COLLECTION VAR]){{< /fatecode >}}
-Adds `[COMPUTATION*]` to `[COLLECTION VAR]`. If `[COLLECTION VAR]` is a
-`[LIST]`, the new member is added at the end of the list. Note that
-`[COMPUTATION*]` does not support use of the variable shorthand.
+Adds `C0` ... `CN` to `[COLLECTION VAR]`. If `[COLLECTION VAR]` is a `[LIST]`,
+the new members are added at the end of the list, in order (meaning that the
+list then ends with `CN`). Note that `[COMPUTATION*]` does not support use of
+the variable shorthand.
### ADDING A MEMBER AT INDEX
{{< fatecode >}}(add_element_at! [INT] [COMPUTATION*] [LIST VAR]){{< /fatecode >}}
@@ -53,19 +54,19 @@ Removes the element of `[COLLECTION]` at `[INT]`.
Reverses the order of the members of `[LIST]`.
### FILTER ELEMENTS
-{{< fatecode >}}(filter! <LAMBDA BOOL (X)> [X COLLECTION VAR]){{< /fatecode >}}
-{{< fatecode >}}(filter! <LAMBDA BOOL (X Y0 ... YN)> [X COLLECTION VAR] [Y0 COMPUTATION*] ... [YN COMPUTATION*]){{< /fatecode >}}
+{{< fatecode >}}(filter! [LAMBDA BOOL (X)] [X COLLECTION VAR]){{< /fatecode >}}
+{{< fatecode >}}(filter! [LAMBDA BOOL (X Y0 ... YN)] [X COLLECTION VAR] [Y0 COMPUTATION*] ... [YN COMPUTATION*]){{< /fatecode >}}
Modifies `[X COLLECTION VAR]` so that only the elements for which
-`<LAMBDA BOOL (X)>` returns `true` remain. If the lambda function needs extra
+`[LAMBDA BOOL (X)]` returns `true` remain. If the lambda function needs extra
parameters, use the second syntax, which adds those parameters at the end of the
`(filter! ...)` call. Note that the variable shorthand cannot be used for these
extra parameters.
### FILTER ELEMENTS (INDEXED)
-{{< fatecode >}}(indexed_filter! <LAMBDA BOOL (INT X)> [X COLLECTION VAR]){{< /fatecode >}}
-{{< fatecode >}}(indexed_filter! <LAMBDA BOOL (INT X Y0 ... YN)> [X COLLECTION VAR] [Y0 COMPUTATION*] ... [YN COMPUTATION*]){{< /fatecode >}}
+{{< fatecode >}}(indexed_filter! [LAMBDA BOOL (INT X)] [X COLLECTION VAR]){{< /fatecode >}}
+{{< fatecode >}}(indexed_filter! [LAMBDA BOOL (INT X Y0 ... YN)] [X COLLECTION VAR] [Y0 COMPUTATION*] ... [YN COMPUTATION*]){{< /fatecode >}}
Modifies `[X COLLECTION VAR]` so that only the elements for which
-`<LAMBDA BOOL (INT X)>` (with the `INT` being the element's index) returns
+`[LAMBDA BOOL (INT X)]` (with the `INT` being the element's index) returns
`true` remain. If the lambda function needs extra parameters, use the second
syntax, which adds those parameters at the end of the `(indexed_filter! ...)`
call. Note that the variable shorthand cannot be used for these extra