@@ -0,0 +1,90 @@
4+Blocks are collections of statements wrapped in braces `{ ... }`. Blocks must return a value of the same type on every branch of execution.
6+The following types of statement are supported:
8+- Variable introduction
12+- If-Then-Else statements
14+Here is an example of a power function defined using a block::
18+ for (i <- 0 until p) {
24+Blocks enable local mutation of their variables, but mutation is not allowed in general. The type system prevents mutable variables from escaping their scope.
26+That is, while the example above is valid, the following does not compile::
33+The variable `n` is not mutable, and so the assignment in the first line of the `do` block is not allowed.
35+This function can be rewritten as follows::
46+For loops iterate over a range of numbers::
50+ for (i <- 0 until 10) {
56+The bounds `0` and `10` are inclusive and exclusive respectively.
61+While loops repeat a set of statements while a boolean expression evaluates to `true`::
73+If-Then-Else Statements
74+-----------------------
76+Else branches are optional, and may contain further `if` statements, just as in Javascript: