Variables

A variable is a storage location identified by a name. Values can be assigned to (stored in) the variable, and the value can later be retrieved by the same name.

Variable (and function, class and module) identifiers are sequences of ordinary latin letters, digits, and the underscore character.

Examples for valid identifiers:

a
Z
AvogadroConstant
avogadro_constant
_4
x1

Examples for invalid identifiers:

9a // starts with a digit
end // is a keyword
This_identifier_is_too_long_to_be_accepted_as_it_is_over_64_chars

IdentifierChar := 'A' to 'Z' | 'a' to 'z' | '_' .
Identifier := IdentifierChar {IdentifierChar | Digit} .

There are three different kinds of variables:

The distinction between global and local variable references in the code is made by module prefixes. See section * () for examples and an explanation.

ModulePrefix := [ModuleName | '.'] '.' .
Variable := [ModulePrefix] Identifier .
ModuleName := Identifier .


© 2004-2010 airbit AG, CH-8008 Zürich
Document AB-M-REF-869