--  'Image of records and arrays (Ada 2022, RM 4.10, D196), as GNAT writes them (each
--  composite on a line of its own, nested ones indented): built from the components' images,
--  nested, of an array with run-time bounds (by a loop) and of a null record.
with Ada.Text_IO; use Ada.Text_IO;
procedure Main is
   type Color is (Red, Green);
   type Point is record
      X, Y : Integer;
   end record;
   type Shape is record
      Corner : Point;
      Hue    : Color;
      Filled : Boolean;
   end record;
   type Vector is array (1 .. 3) of Integer;
   type Values is array (Positive range <>) of Integer;
   type Empty is null record;
   P : constant Point := (1, -2);
   S : constant Shape := ((3, 4), Green, True);
   V : constant Vector := (10, 20, 30);
   function Make (N : Natural) return Values is ([for I in 1 .. N => I * I]);
   E : constant Empty := (null record);
begin
   Put_Line (P'Image);
   Put_Line (S'Image);
   Put_Line (V'Image);
   Put_Line (Make (4)'Image & " " & Make (0)'Image);
   Put_Line (Point'Image ((7, 8)) & " " & E'Image);
end Main;
