comp.lang.ada
 help / color / mirror / Atom feed
From: reinert <reinkor@gmail.com>
Subject: How to test if file = Ada.Text_IO.Standard_Input ?
Date: Sat, 23 Oct 2021 01:06:38 -0700 (PDT)	[thread overview]
Message-ID: <93df825f-5c18-4a02-a399-74c7ee7cf784n@googlegroups.com> (raw)

Hello,

the following program:

  procedure test1 (file1 : in Ada.Text_IO.File_Type) is
      term1 : constant Boolean := file1 in Ada.Text_IO.Standard_Input;
   begin
      null;
   end test1;

compiles under gnat-10 (debian). The point here is to test if "file1" represents the terminal.

However, when I try to compile using the current GNAT Community Edition from AdaCore, I get the error:

test7.adb:38:41: error: invalid operand types for operator "="
test7.adb:38:41: error: left operand has private type "Ada.Text_Io.File_Type"
test7.adb:38:41: error: right operand has type "Ada.Text_Io.File_Access"
gnatmake: "test7.adb" compilation error

So how can I test if "file1" referes to the terminal using the lastest GNAT Community Edition?

reinert

             reply	other threads:[~2021-10-23  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-23  8:06 reinert [this message]
2021-10-23 10:22 ` How to test if file = Ada.Text_IO.Standard_Input ? Jeffrey R.Carter
2021-10-23 12:28   ` reinert
2021-10-23 15:40     ` Gautier write-only address
2021-10-24 20:51   ` Keith Thompson
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox