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
parent563f9cab92c48a2bd003c10248f21007e5ff64e6 (diff)
...
-rw-r--r--content/fate_v1/computations/_index.md8
-rw-r--r--content/fate_v1/computations/collections/_index.md37
-rw-r--r--content/fate_v1/computations/conditionals/_index.md6
-rw-r--r--content/fate_v1/declarations/sequences/_index.md2
-rw-r--r--content/fate_v1/declarations/types/_index.md8
-rw-r--r--content/fate_v1/instructions/collections/_index.md21
-rw-r--r--content/fate_v1/instructions/conditionals/_index.md4
-rw-r--r--content/wyrd_v1/computations/_index.md2
8 files changed, 57 insertions, 31 deletions
diff --git a/content/fate_v1/computations/_index.md b/content/fate_v1/computations/_index.md
index 1cad064..71fe6f4 100644
--- a/content/fate_v1/computations/_index.md
+++ b/content/fate_v1/computations/_index.md
@@ -20,7 +20,7 @@ applicable. Structure members can be accessed by using `.` in `{String}`.
{{< fatecode >}}{Structure Var Name}.{Field Name}{{< /fatecode >}}
{{< fatecode >}}(field [STRUCTURE VAR] {String}){{< /fatecode >}}
-Accesses the `{String}` field of the structure `<STRUCTURE_VAR>`. Using `.` to
+Accesses the `{String}` field of the structure `[STRUCTURE VAR]`. Using `.` to
access fields is recommended over the use of this operator.
### STRUCTURE FIELD VALUE
@@ -33,10 +33,10 @@ Returns the value of the `{String}` field of the structure `[STRUCTURE]`.
Defines a hierarchical level and local variables `V0` ... `VN` with values `C0` ... `CN`, and returns the value of `[R]`.
### CAST
-{{< fatecode >}}(cast [TYPE] <COMPUTATION*>){{< /fatecode >}}
+{{< fatecode >}}(cast [TYPE] [COMPUTATION*]){{< /fatecode >}}
-Transforms `<COMPUTATION*>` into a value of type `[TYPE]`. Note that the variable
-shorthand cannot be used for `<COMPUTATION*>`. The following type changes are
+Transforms `[COMPUTATION*]` into a value of type `[TYPE]`. Note that the variable
+shorthand cannot be used for `[COMPUTATION*]`. The following type changes are
allowed:
* `[FLOAT]` to `[FLOAT]`, `[INT]`, and `[STRING]`.
* `[INT]` to `[FLOAT]`, `[INT]`, and `[STRING]`.
diff --git a/content/fate_v1/computations/collections/_index.md b/content/fate_v1/computations/collections/_index.md
index 63c62cc..ec1c3e6 100644
--- a/content/fate_v1/computations/collections/_index.md
+++ b/content/fate_v1/computations/collections/_index.md
@@ -25,10 +25,11 @@ Returns a copy of `[LIST]` with `[COMPUTATION*]` added at index `[INT]`. Note
that `[COMPUTATION*]` does not allow use of the variable shorthand.
### ADD ELEMENT
-{{< fatecode >}}(add_element [COMPUTATION*] [COLLECTION]){{< /fatecode >}}
+{{< fatecode >}}(add_element [C0 = COMPUTATION*] ... [CN = COMPUTATION*] [COLLECTION]){{< /fatecode >}}
-Returns a copy of `[COLLECTION]` with `[COMPUTATION*]` added. If `[COLLECTION]`
-is a `[LIST]`, then the element is added at the end of the list.
+Returns a copy of `[COLLECTION]` with `C0` ... `CN` added. If `[COLLECTION]`
+is a `[LIST]`, then the elements are added at the end of the list, in order
+(meaning that `CN` will be the last element added).
Note that `[COMPUTATION*]` does not allow use of the variable shorthand.
### ADDING MEMBERS
@@ -69,7 +70,7 @@ Returns true if, and only if `[COLLECTION]` is empty.
{{< fatecode >}}(filter [LAMBDA BOOL (X Y0 ... YN)] [X COLLECTION] [Y0 COMPUTATION*] ... [YN COMPUTATION*]){{< /fatecode >}}
Returns a copy of `[X COLLECTION]` in which 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.
@@ -79,7 +80,7 @@ extra parameters.
{{< fatecode >}}(indexed_filter [LAMBDA BOOL (INT X Y0 ... YN)] [X COLLECTION] [Y0 COMPUTATION*] ... [YN COMPUTATION*]){{< /fatecode >}}
Returns a copy of `[INT X COLLECTION]` in which only the elements for which
-`<LAMBDA BOOL (INT X)>` (with `INT` being the element's index) returns `true`
+`[LAMBDA BOOL (INT X)]` (with `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 parameters.
@@ -90,9 +91,33 @@ that the variable shorthand cannot be used for these extra parameters.
{{< fatecode >}}(foldr [LAMBDA X (X Y)> [X COMPUTATION*] [Y COLLECTION]){{< /fatecode >}}
{{< fatecode >}}(foldr [LAMBDA X (X Y Z0 ... ZN)] [X COMPUTATION*] [Y COLLECTION] [Z0 COMPUTATION*] ... [ZN COMPUTATION*]){{< /fatecode >}}
-Returns the result of iterating `<LAMBDA X (X Y)>` over `[Y COLLECTION]`, with
+Returns the result of iterating `[LAMBDA X (X Y)]` over `[Y COLLECTION]`, with
`[X COMPUTATION*]` being the initial value. The direction of the iteration is
by ascending index order when using `foldl`, and the opposite order when using
`foldr`. Extra parameters for the lambda function can be passed as extra
parameters of the call. Note that the variable shorthand cannot be used for
those extra parameters, nor for the initial value.
+
+### MERGE COLLECTIONS
+{{< fatecode >}}(merge_to_list [LAMBDA O (X Y)] [X COLLECTION] [Y COLLECTION]){{< /fatecode >}}
+{{< fatecode >}}(merge_to_list [LAMBDA O (X Y Z0 ... ZN)] [X COLLECTION] [Y COLLECTION] [Z0 COMPUTATION*] ... [ZN COMPUTATION*]){{< /fatecode >}}
+{{< fatecode >}}(merge_to_set [LAMBDA O (X Y)] [X COLLECTION] [Y COLLECTION]){{< /fatecode >}}
+{{< fatecode >}}(merge_to_set [LAMBDA O (X Y Z0 ... ZN)] [X COLLECTION] [Y COLLECTION] [Z0 COMPUTATION*] ... [ZN COMPUTATION*]){{< /fatecode >}}
+
+### SAFE-MERGE COLLECTIONS
+{{< fatecode >}}(safe_merge_to_list [LAMBDA O (X Y)] [X COLLECTION] [X COMPUTATION*] [Y COLLECTION] [Y COMPUTATION*]){{< /fatecode >}}
+{{< fatecode >}}(safe_merge_to_list [LAMBDA O (X Y Z0 ... ZN)] [X COLLECTION] [X COMPUTATION*] [Y COLLECTION] [Y COMPUTATION*] [Z0 COMPUTATION*] ... [ZN COMPUTATION*]){{< /fatecode >}}
+{{< fatecode >}}(safe_merge_to_set [LAMBDA O (X Y)] [X COLLECTION] [X COMPUTATION*] [Y COLLECTION] [Y COMPUTATION*]){{< /fatecode >}}
+{{< fatecode >}}(safe_merge_to_set [LAMBDA O (X Y Z0 ... ZN)] [X COLLECTION] [X COMPUTATION*] [Y COLLECTION] [Y COMPUTATION*] [Z0 COMPUTATION*] ... [ZN COMPUTATION*]){{< /fatecode >}}
+
+### MERGE COLLECTIONS (INDEXED)
+{{< fatecode >}}(indexed_merge_to_list [LAMBDA O (INT X Y)] [X COLLECTION] [Y COLLECTION]){{< /fatecode >}}
+{{< fatecode >}}(indexed_merge_to_list [LAMBDA O (INT X Y Z0 ... ZN)] [X COLLECTION] [Y COLLECTION] [Z0 COMPUTATION*] ... [ZN COMPUTATION*]){{< /fatecode >}}
+{{< fatecode >}}(indexed_merge_to_set [LAMBDA O (INT X Y)] [X COLLECTION] [Y COLLECTION]){{< /fatecode >}}
+{{< fatecode >}}(indexed_merge_to_set [LAMBDA O (INT X Y Z0 ... ZN)] [X COLLECTION] [Y COLLECTION] [Z0 COMPUTATION*] ... [ZN COMPUTATION*]){{< /fatecode >}}
+
+### SAFE-MERGE COLLECTIONS (INDEXED)
+{{< fatecode >}}(safe_indexed_merge_to_list [LAMBDA O (INT X INT Y)] [X COLLECTION] [X COMPUTATION*] [Y COLLECTION] [Y COMPUTATION*]){{< /fatecode >}}
+{{< fatecode >}}(safe_indexed_merge_to_list [LAMBDA O (INT X INT Y Z0 ... ZN)] [X COLLECTION] [X COMPUTATION*] [Y COLLECTION] [Y COMPUTATION*] [Z0 COMPUTATION*] ... [ZN COMPUTATION*]){{< /fatecode >}}
+{{< fatecode >}}(safe_indexed_merge_to_set [LAMBDA O (INT X INT Y)] [X COLLECTION] [X COMPUTATION*] [Y COLLECTION] [Y COMPUTATION*]){{< /fatecode >}}
+{{< fatecode >}}(safe_indexed_merge_to_set [LAMBDA O (INT X INT Y Z0 ... ZN)] [X COLLECTION] [X COMPUTATION*] [Y COLLECTION] [Y COMPUTATION*] [Z0 COMPUTATION*] ... [ZN COMPUTATION*]){{< /fatecode >}}
diff --git a/content/fate_v1/computations/conditionals/_index.md b/content/fate_v1/computations/conditionals/_index.md
index 2953489..7b65294 100644
--- a/content/fate_v1/computations/conditionals/_index.md
+++ b/content/fate_v1/computations/conditionals/_index.md
@@ -12,14 +12,14 @@ Returns `C0` is `[BOOL]` yields true, `C1` otherwise.
### COND
{{< fatecode >}}(cond ([B0 = BOOL] [C0 = COMPUTATION]) ... ([BN = BOOL] [CN = COMPUTATION])){{< /fatecode >}}
-Returns `<Ci>`, such that `<Bi>` is the first to hold true. If there is not such
+Returns `[CI]`, such that `[BI]` is the first to hold true. If there is not such
`Bi`, returns `[CN]`.
### SWITCH
{{< fatecode >}}(switch [T = COMPUTATION] ([V0 = COMPUTATION] [C0 = COMPUTATION]) ... ([VN = BOOL] [CN = COMPUTATION]) [D = COMPUTATION]){{< /fatecode >}}a
-Returns the first `Ci` such that `Vi` is equal to `T`. If there is not such
-`Vi`, returns `[D]`.
+Returns the first `CI` such that `VI` is equal to `T`. If there is not such
+`VI`, returns `[D]`.
## Examples
{{< fatecode >}}(cond
diff --git a/content/fate_v1/declarations/sequences/_index.md b/content/fate_v1/declarations/sequences/_index.md
index 8bdb30e..a2fbcb1 100644
--- a/content/fate_v1/declarations/sequences/_index.md
+++ b/content/fate_v1/declarations/sequences/_index.md
@@ -28,7 +28,7 @@ instruction list by the execution of the sequence. If one were to ignore
variables, the `(jump_to sequence_name)` instruction is similar to performing
`(call sequence_name) (done)`.
-{{< fatecode >}}(define_sequence {String} (([C0 = TYPE] {V0 = String}) ... ([CN = TYPE] {VN = String})) <I0 = INSTRUCTIONS|VALUE> ... <IM = INSTRUCTIONS|VALUE>){{< /fatecode >}}
+{{< fatecode >}}(define_sequence {String} (([C0 = TYPE] {V0 = String}) ... ([CN = TYPE] {VN = String})) [I0 = INSTRUCTIONS|VALUE] ... [IM = INSTRUCTIONS|VALUE]){{< /fatecode >}}
**Effect:** Defines the sequence `{String}`, with variables `V0` ... `VN` of types `C0` ...`CN` as parameters, and instructions `I0` ... `IM` as content.
**Acceptable Aliases:** `declare_sequence`, `def_seq`, `define_procedure`, `declare_procedure`, `def_proc`.
diff --git a/content/fate_v1/declarations/types/_index.md b/content/fate_v1/declarations/types/_index.md
index 9a3677f..52f8154 100644
--- a/content/fate_v1/declarations/types/_index.md
+++ b/content/fate_v1/declarations/types/_index.md
@@ -28,9 +28,9 @@ Two collection types are available:
* `(set [COMPARABLE TYPE])`
Lambda computations are available:
-* `(lambda <r = TYPE> (<a0 = TYPE> ... <an = TYPE>))` is a type corresponding
- to a lambda function returning a value of type `r` and taking parameters of
- types `a0` ... `an`.
+* `(lambda [R = TYPE] ([A0 = TYPE] ... [AN = TYPE]))` is a type corresponding
+ to a lambda function returning a value of type `R` and taking parameters of
+ types `A0` ... `AN`.
### Common Type Groupings
* `[NUMBER]` corresponds to `int`, `float`.
@@ -49,7 +49,7 @@ Lambda computations are available:
`[PRIMITIVE]`, `{String}` is a subtype of `[TYPE]`.
### Structures
-{{< fatecode >}}(declare_structure_type {String} (<t0 = TYPE> {f0 = String}) ... (<tn = TYPE> {fn = String})){{< /fatecode >}}.
+{{< fatecode >}}(declare_structure_type {String} ([T0 = TYPE] {F0 = String}) ... ([TN = TYPE] {fn = String})){{< /fatecode >}}.
## Examples
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 >}}
diff --git a/content/wyrd_v1/computations/_index.md b/content/wyrd_v1/computations/_index.md
index c4ccff0..62ddd41 100644
--- a/content/wyrd_v1/computations/_index.md
+++ b/content/wyrd_v1/computations/_index.md
@@ -74,7 +74,7 @@ Returns the number of elements held by the collection at
Returns an `ADDRESS` to the memory element at address `[COMPUTATION]`. Raises a
runtime error if `[COMPUTATION]` is not a memory element.
-{{< fatecode >}}(relative_address <R0 = (COLLECTION|STRUCTURE) ADDRESS> [STRING]){{< /fatecode >}}
+{{< fatecode >}}(relative_address [R0 = (COLLECTION|STRUCTURE) ADDRESS] [STRING]){{< /fatecode >}}
Returns a `REFERENCE` to member `[STRING]` of `R0`.
{{< fatecode >}}(value_of [ADDRESS]){{< /fatecode >}}