WITH Ada.Text_IO; PROCEDURE Anonymous_Array_Bounds IS TYPE IntRanged IS ARRAY (Integer RANGE <>) OF Integer; TYPE PositiveRanged IS ARRAY (Positive RANGE <>) OF Integer; TYPE CharacterRanged IS ARRAY (Character RANGE <>) OF Integer; TYPE BooleanRanged IS ARRAY (Boolean RANGE <>) OF Integer; --TYPE FloatRanged IS ARRAY (Float RANGE <>) OF Integer; --error: discrete type required for index PROCEDURE show_intrange (x : IntRanged) IS BEGIN Ada.Text_IO.Put_Line("Bounds: "&Integer'IMAGE(x'FIRST)& ", "&Integer'IMAGE(x'LAST)); END show_intrange; PROCEDURE show_posrange (x : PositiveRanged) IS BEGIN Ada.Text_IO.Put_Line("Bounds: "&Positive'IMAGE(x'FIRST)& ", "&Positive'IMAGE(x'LAST)); END show_posrange; PROCEDURE show_chrrange (x : CharacterRanged) IS BEGIN Ada.Text_IO.Put_Line("Bounds: "&Character'IMAGE(x'FIRST)& ", "&Character'IMAGE(x'LAST)); END show_chrrange; PROCEDURE show_boolrange (x : BooleanRanged) IS BEGIN Ada.Text_IO.Put_Line("Bounds: "&Boolean'IMAGE(x'FIRST)& ", "&Boolean'IMAGE(x'LAST)); END show_boolrange; BEGIN show_intrange((1, 2, 3)); show_posrange((1, 2, 3)); show_chrrange((1, 2, 3)); show_boolrange((1, 2)); --show_boolrange((1, 2, 3)); warning: upper bound out of range END Anonymous_Array_Bounds;