-- Demonstrates that Ada has a real for loop
with ada.text_io; use ada.text_io; 
with ada.integer_text_io; use ada.integer_text_io; 
 
procedure ada_for  is 

   procedure putupto(last: Integer) is
   begin
      --  last := 99; -- won't compile
      for b in last - 2 .. last loop
         put_line(b'img);
      end loop;
   end putupto;

   somevalue: Integer := 12;

begin

   putupto(somevalue);         --   10 11 12

   putupto(-12);               --  -12 -11 -10

   putupto(Integer'last - 2);  --  2147483645 2147483646 2147483647

end ada_for;