--  Operator symbols as names (RM 4.1, 6.1, 6.4, 12.3): a call in prefix notation, by
--  position or by name; a generic actual named by its formal operator's symbol; an
--  operator declared with its letters in capitals; and a block whose name a declaration
--  inside it hides (RM 5.6, 8.1).
with Ada.Text_IO;
procedure Main is
   type Enum is (Lo, Hi);
   function "AND" (L, R : Enum) return Enum is (if L = Hi and R = Hi then Hi else Lo);
   generic
      type T is private;
      with function "=" (L, R : T) return Boolean is <>;
   function Same (L, R : T) return Boolean;
   function Same (L, R : T) return Boolean is (L = R);
   function Equal is new Same (T => Integer, "=" => "=");
   S : constant String := "ab";
begin
   Ada.Text_IO.Put_Line (Boolean'Image ("=" (S, "ab")) & Integer'Image ("&" (S, "cd")'Length));
   Ada.Text_IO.Put_Line (Integer'Image ("-" (Right => 5, Left => 7)) & Integer'Image ("ABS" (-3)));
   Ada.Text_IO.Put_Line (Enum'Image (Hi and Hi) & Enum'Image ("and" (Hi, Lo)) & Boolean'Image (Equal (1, 1)));
   A : declare
      A : Integer := 1;
   begin
      A := A + 1;
      Ada.Text_IO.Put_Line (Integer'Image (A));
   end A;
end Main;
