Next: , Previous: Typing, Up: Variables Overview



5.1.4 Initialization

When defining a variable, you can optionally specify an initial value for the variable:

         global a = 5;

indicates that the initial value of a is the value 5 (and also implicitly types a as type count, per Typing).

The syntax of an initialization is “= expression”, where the given expression must be assignment-compatible with the variable's type (if explicitly given). Tables and sets also have special initializer forms, which are discussed in XXX and XXX.