Variable Declaration

Int i as variable declaration,
very much as in C/C++ (and Java, C#).

TypeName variableName

Some simplifications and restrictions:

Examples

Type Inference

with var / const:

Structured Binding

C++17 structured bindings unpack one value into several names: a pair, a tuple, an array, or an aggregate.
var instead of auto, and { } instead of [ ]:

The names are declared here, and each name’s type is inferred from its element, as with var.
A constant binding is const {a, b} = ..., instead of const auto [a, b] = ...; — the same idea as const i = 3 above.

This is not a multiple-variable declaration (Int x, y).
The names need not share one type — a String and an Int from one pair is fine — and there is exactly one name per element.

{ } rather than [ ], because [ ] is already the array and map declarator (Int[10], Float[String]).

Const

const always binds to the right (contrary to C/C++).

Global Objects

Unlike functions, which are available in every .cil file of a project, a normal object at the top level of a .cil file is visible only in that file.

Int a

It is not visible in the other .cil files of the project. This corresponds to static Int a in C/C++.

A top-level object becomes visible in the other .cil files of the project only when marked global:

global Int a

Only such a global declaration is known throughout the project.

Note
Global state should generally be avoided, so the default – the simple expression – is ‘file-local’.

Bit Fields

Not Allowed

It is a syntax error to write: