unconstrained_array_definition | constrained_array_definition
array(index_subtype_definition {, index_subtype_definition}) of component_definition
array (discrete_subtype_definition {, discrete_subtype_definition}) of component_definition
procedure Get_Next(Next_Value : out Integer);
--Returns the next value on each call, bumping Count
--before returning.
private
Count : Integer := Initial_Value;
end Counter_Type;
protected body Counter_Type is ...
Result : Integer;
begin
Counter.Get_Next(Result);
return Result;
end Next_Id;
task type T(Who_Am_I : Integer := Next_Id(C'Access));
task body T is ...
--Array of task elements, each with its own unique ID.
--We specify "aliased" so we can use Task_Array(I)'Access.
--This is safe because Task_Array is of a limited type,
--so there is no way an assignment to it could change
--the discriminants of one of its components.
type Matrix is array(Integer range <>, Integer range <>) of Real;
type Bit_Vector is array(Integer range <>) of Boolean;
type Roman is array(Positive range <>) of Roman_Digit; -- see 3.5.2
type Schedule is array(Day) of Boolean;
type Line is array(1 .. Max_Line_Size) of Character;
Mix : array(Color range Red .. Green) of Boolean;
Page : array(Positive range <>) of Line := -- an array of arrays
(1 | 50 => Line'(1 | Line'Last => '+', others => '-'), -- see 4.3.3
2 .. 49 => Line'(1 | Line'Last => '|', others => ' '));
-- Page is constrained by its initial value to (1..50)
Rectangle : Matrix(1 .. 20, 1 .. 30);
Inverse : Matrix(1 .. N, 1 .. N); -- N need not be static
record
Image : String(1 .. Length);
end record;
-- Rectangle'Last(1) = 20 Rectangle'Last(2) = 30
type Wide_String is array(Positive range <>) of Wide_Character;
Question : constant String := "How many characters?";
-- Question'First = 1, Question'Last = 20
-- Question'Length = 20 (the number of characters)
Ninety_Six : constant Roman := "XCVI"; -- see 3.5.2 and