| summaryrefslogtreecommitdiff | 
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-12-22 23:34:09 +0100 | 
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2020-12-22 23:34:09 +0100 | 
| commit | 7272d83113545ec46b35ea440811dfc7da7634e1 (patch) | |
| tree | 40642cdafdf859c63e0c8e3b6d02d3e4ba8eabf7 /content/fate_v1/instructions | |
| parent | 563f9cab92c48a2bd003c10248f21007e5ff64e6 (diff) | |
...
Diffstat (limited to 'content/fate_v1/instructions')
| -rw-r--r-- | content/fate_v1/instructions/collections/_index.md | 21 | ||||
| -rw-r--r-- | content/fate_v1/instructions/conditionals/_index.md | 4 | 
2 files changed, 13 insertions, 12 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 diff --git a/content/fate_v1/instructions/conditionals/_index.md b/content/fate_v1/instructions/conditionals/_index.md index e129b1b..39a51b3 100644 --- a/content/fate_v1/instructions/conditionals/_index.md +++ b/content/fate_v1/instructions/conditionals/_index.md @@ -11,9 +11,9 @@ local variables' point of view.  Executes `[INSTRUCTION]` if, and only if, `[BOOL]` yields true.  ### IF-ELSE -{{< fatecode >}}(if_else [BOOL] <IF_TRUE = INSTRUCTION> <IF_FALSE = INSTRUCTION>){{< /fatecode >}} +{{< fatecode >}}(if_else [BOOL] [IF_TRUE = INSTRUCTION] [IF_FALSE = INSTRUCTION]){{< /fatecode >}} -Executes `<IF_TRUE>` if `[BOOL]` yields true, but `<IF_FALSE>` if it does not. +Executes `[IF_TRUE]` if `[BOOL]` yields true, but `[IF_FALSE]` if it does not.  ### COND  {{< fatecode >}}(cond ([C0 = BOOL] [I0 = INSTRUCTION]) ... ([CN = BOOL] [IN = INSTRUCTION])){{< /fatecode >}} | 


