Basic expressions
Block expressions
An indented block is a kind of expression. Every function body is a block expression.
Block expressions can nest inside of other expressions.
The beginning and ending of an indented block act like like parentheses.
Like any expression, you need a comma before an indented block to separate it from other arguments.
Sequence expressions
A sequence expression evaluates each subexpression in sequence.
Subexpressions are separated by newlines (at the same indent level).
The value of a sequence expression is the value of the last line.
All other lines must be void.
A sequence expression can go inside a block expression.
Locals
Creating a new local variable is simple: name = ...
A type after the name is optional.
mut makes the local mutable.
:= mutates the local.
If present, the type goes after mut.
Ignoring things
A sequence expression requires void subexpressions (except the last),
but sometimes you want to ignore a non-void value.
To do so, assign it to _.
You can even give it a type annotation if necessary.
_ works in parameters too.
Scope
Locals can be nested inside other expressions.
The local is only in scope within its own expression.