Adaのloopとexit

Adaのloopは永久ループなので、exitで処理を抜けます。

-- Float
--変数
with Ada.Text_IO;
use Ada.Text_IO;
with Ada.Integer_Text_IO;
use Ada.Integer_Text_IO;

procedure MyApp is
   count: integer;
   i: integer := 1;
begin
 get(count);
 loop
   put(i);
   new_line;
   i := i + 1;
   exit when i > count;
 end loop;
end MyApp;
[vagrant@localhost ada_lessons]$ gnatmake myapp.adb
gcc -c myapp.adb
gnatbind -x myapp.ali
gnatlink myapp.ali
[vagrant@localhost ada_lessons]$ ./myapp
4
          1
          2
          3
          4