1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use crate;
use crateRoundVM;
use FromStr;
/// Evaluates the given expressions and returns the result based on the given condition.
/// N.B both th and el will be evaluated, thus they will both affect the [Path], but only the result of one of them will be returned.
///
/// # Arguments
/// * `vm` - The current VM.
/// * `cond` - The condition to evaluate, which should return a boolean.
/// * `th` - The then-expression to evaluate.
/// * `el` - The else-expression to evaluate.
///
/// # Returns
/// The result of the evaluation of the then-expression if the condition is true, else the result of the evaluation of the else-expression alongside the RoundVM.
/// Performs a foldhood on the given expression, excluding self from the aligned neighbors.
///
/// # Arguments
///
/// * `vm` the current VM
/// * `init` the initial value
/// * `aggr` the function to apply to the value
/// * `expr` the expression to evaluate
///
/// # Generic Parameters
///
/// * `A` The type of value returned by the expression.
/// * `F` - The type of init, which must be a closure that takes no arguments and returns a value of type `A`.
/// * `G` - The type of aggr, which must be a closure that takes a tuple `(A, A)` and returns a value of type `A`.
/// * `H` - The type of expr, which must be a closure that takes a `RoundVM` as argument and returns a tuple `(RoundVM, A)`.
///
/// # Returns
///
/// the aggregated value