comp.lang.ada
 help / color / mirror / Atom feed
From: Marius Amado Alves <amado.alves@netcabo.pt>
To: comp.lang.ada@ada-france.org
Subject: Re: SEQUENTIA_IO and stdin/stdout (Standard_Input, Standard_Output)
Date: Wed, 15 Oct 2003 17:23:41 +0000
Date: 2003-10-15T17:23:41+00:00	[thread overview]
Message-ID: <mailman.95.1066291541.25614.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: <tZCPrl8On+6r@eisner.encompasserve.org>

> Which of the three steps is not guaranteed ?
> 
> 	Finding the value of File_Type
> 	Finding the name of the corresponding file
> 	Opening the file
> 
> If it is the last, I would expect a failure to open would signal an exception.

I would to. But GNAT does not complaint. At least with a sequential file
of characters. It simply does not output. Maybe it's because I'm not
closing Standard_Output prior to opening it as a sequential file. But I
wouldn't know how to do that. Procedure Close requires a variable, and
you cannot set a file type variable to Standard_Output (because
File_Type is limited).

I agree some kind of clarification on this issue is desirable. Maybe it
has been done already. Or a binding interpretation. Someone should check
it out ;-) Note Robert Eachus already said "it may or may not work".
Maybe he's willing to elaborate ;-)

Personally I don't feel comfortable with two things:

1. The (external) name of a standard channel. Even in C this does not
exist. GNAT says "*stdout", "*stdin". Note the asterisk. This reeks of implementation dependency. I
seem to remember MS-DOS having "CON" for this. I think the ARM is silent
on this anyway.

2. Crossing information between Text_IO and (an instance of)
Sequential_IO. Even if this information is just the name of the external
file.

In sum: there is doubtful solution (and erroneous with GNAT, or so it
seems), and there is an alternate, legal solution. The choice should be
clear.

As I indicated before, I suspect Ada has a weak point here. Namely
binding the standard channels exclusively to Text_IO. Surely the
standard channel concept is less dependent of file format than that.





  reply	other threads:[~2003-10-15 17:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-14 12:44 SEQUENTIA_IO and stdin/stdout Lo Shu
2003-10-14 14:29 ` SEQUENTIA_IO and stdin/stdout (Standard_Input, Standard_Output) Larry Kilgallen
2003-10-14 16:45   ` Marius Amado Alves
2003-10-14 20:36     ` Robert I. Eachus
2003-10-14 23:11     ` Larry Kilgallen
2003-10-14 23:11       ` Marius Amado Alves
2003-10-15  4:32         ` Larry Kilgallen
2003-10-15 17:23           ` Marius Amado Alves [this message]
2003-10-17 13:41             ` Frank J. Lhota
replies disabled

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