blob: 82acb2805fc08fd13b8abcbcff1ccebcfaa5850a (
plain)
| 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
 | ---
title: Loops
---
Allow the repetition of a group of instructions according to a computation.
Every loop body defines its hierarchy level, from the local variables' point of
view.
### WHILE
{{< fatecode >}}(while [BOOL]
   [I0 = INSTRUCTION]
   ...
   [IM = INSTRUCTION]
){{< /fatecode >}}
Executes `[I0]` ... `[IM]` if, and as long as, `[BOOL]` yields true.
### DO WHILE
{{< fatecode >}}(do_while [BOOL]
   [I0 = INSTRUCTION]
   ...
   [IM = INSTRUCTION]
){{< /fatecode >}}
Executes `[I0]` ... `[IM]`,  and does so again as long as, `[BOOL]` yields
true.
### FOR
{{< fatecode >}}(for
   [PRE = INSTRUCTION]
   [BOOL]
   [POST = INSTRUCTION]
   [I0 = INSTRUCTION]
   ...
   [IM = INSTRUCTION]
){{< /fatecode >}}
Executes `[PRE]`, then, if and as long as `[BOOL]` yields true, executes
`[I0]` ... `[IM]` followed by `[POST]`.
### FOR EACH
{{< fatecode >}}(foreach [COLLECTION] {String}
   [I0 = INSTRUCTION]
   ...
   [IM = INSTRUCTION]
){{< /fatecode >}}
Executes `[I0]` ... `[IM]` for each member of `[COLLECTION]`, in order. The current
member is stored in a new local variable named `{String}`.
### BREAK
{{< fatecode >}}(break!){{< /fatecode >}}
Exits the current loop.
 |