Expressions are the building blocks of any program. Values, variables, constants, and functions are combined to form expressions, which, in turn, are combined to form a program. When the program is run, expressions are interpreted according to the rules set by the particular language. These rules can include precedence and associativity, and they produce results and possibly a new state for the program.
Swift is no different. It provides four types of expressions:
Evaluating expressions in Swift produces a result, a side effect, or both. There are some expressions that require more information. I’ll take a look at these and expand on their features and requirements.
Note An expression ...