identifier_list :
[constant
] subtype_indication [:= expression];
| identifier_list :
[constant
] constrained_array_definition [:= expression];
number_declaration ::=
identifier_list : constant
:= universal_static_expression;
-- the multiple object declaration
new
PERSON(SEX => M); -- see 3.8.1
-- is equivalent to the two single object declarations in the
-- order given
new
PERSON(SEX => M);
PAUL : PERSON_NAME := new
PERSON(SEX => M);
constant
appears in the object declaration; the declaration must then include an explicit initialization. The value of a constant cannot be modified after initialization. Formal parameters of mode in
of subprograms and entries, and generic formal parameters of mode in
, are also constants; a loop parameter is a constant within the corresponding loop; a subcomponent or slice of a constant is a constant.
constant
is a variable). The only ways to change the value of a variable are either directly by an assignment, or indirectly when the variable is updated (see 6.2) by a procedure or entry call statement (this action can be performed either on the variable itself, on a subcomponent of the variable, or on another variable that has the given variable as subcomponent).
COUNT, SUM : INTEGER;
SIZE : INTEGER range
0 .. 10_ := 0;
SORTED : BOOLEAN := FALSE;
COLOR_TABLE : array
(1 .. N) of
COLOR;
OPTION : BIT_VECTOR(1 .. 10) := (others
=> TRUE);
LIMIT :
constant
INTEGER := 10;
LOW_LIMIT : constant
INTEGER := LIMIT/10;
TOLERANCE : constant
REAL := DISPERSION(1.15);
PI :
constant
:= 3.14159_26536; -- a real number
TWO_PI : constant
:= 2.0*PI; -- a real number
MAX : constant
:= 5 -- an integer number
POWER_16 : constant
:= 2**16; -- the integer 65_536
ONE, UN, EINS : constant
:= 1; -- three different names
for 1