vendethiel / read

(Meta) Read list.
0 stars 0 forks source link

Ada Intro : Arrays (bookmark) #106

Closed vendethiel closed 2 years ago

vendethiel commented 2 years ago

https://learn.adacore.com/courses/intro-to-ada/chapters/arrays.html

vendethiel commented 2 years ago

https://learn.adacore.com/courses/intro-to-ada/chapters/arrays.html#restrictions

procedure Indefinite_Subtypes is
    function Get_Number return Integer is
    begin
        return Integer'Value (Get_Line);
    end Get_Number;

   A : String := "Hello";
   --  Indefinite subtype

   B : String (1 .. 5) := "Hello";
   --  Definite subtype

   C : String (1 .. Get_Number);
   --  Indefinite subtype
   --  (Get_Number's value is computed at
   --  run-time)
begin
   null;
end Indefinite_Subtypes;