--  APL results whose first index is 0 or a machine integer's minimum, empty and not: their
--  ranges need no predecessor of the first index (and, written as plain Ada, no conditional
--  expression around a reduction).
pragma Extensions_Allowed (On);
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
   type Natural_Vector is array (Natural range <>) of Integer;
   type Machine_Vector is array (Integer range <>) of Integer;
   X : constant Natural_Vector := (3, 1, 4, 1, 5);
   Kept : constant Natural_Vector := APL ("(X > 2) / X");
   None : constant Natural_Vector := APL ("(X > 100) / X");
   Low_Kept : constant Machine_Vector := APL ("(X > 2) / X");
   Low_None : constant Machine_Vector := APL ("(X > 100) / X");
   Doubled : constant Machine_Vector := APL ("X × 2");
begin
   Put_Line (Integer'Image (Kept'First) & Integer'Image (Kept'Length) & Integer'Image (Kept (Kept'Last)));
   Put_Line (Integer'Image (None'Length));
   Put_Line (Boolean'Image (Low_Kept'First = Integer'First) & Integer'Image (Low_Kept'Length) & Integer'Image (Low_Kept (Low_Kept'First)));
   Put_Line (Integer'Image (Low_None'Length));
   Put_Line (Boolean'Image (Doubled'First = Integer'First) & Integer'Image (Doubled (Doubled'Last)));
end Main;
