September 2013
Intermediate to advanced
548 pages
12h 25m
English
Block expressions are used when the Erlang syntax requires a single
expression, but we want to have a sequence of expressions at
this point in the code. For example, in a list comprehension of the
form [E || ...], the syntax requires E to be a single
expression, but we might want to do several things in E.
| | begin |
| | Expr1, |
| | ..., |
| | ExprN |
| | end |
You can use block expressions to group a sequence of expressions,
similar to a clause body. The value of a begin ... end
block is the value of the last expression in the block.
Read now
Unlock full access