Expressions
Expression blocks are semicolon separated list of expression. The last expression define the type of the whole expression.
The semicolon let the developer to ignore the result of an expression, but it is only possible for unit expression; the following expression will fail to compile:
Depending of where you declare an expression, the scope will change; for instance inside an entrypoint expression you can access the contract fields.
You can bind a name to an expression using let syntax:
Which can be written also as:
Let is also useful for tuple destructuring:
Last updated