comp.lang.ada
 help / color / mirror / Atom feed
From: sampson@cod.NOSC.MIL (Charles H. Sampson)
Subject: Re: TEXT_IO anomality
Date: 25 Jul 90 17:14:42 GMT	[thread overview]
Message-ID: <2020@cod.NOSC.MIL> (raw)
In-Reply-To: 9007241309.AA00417@ajpo.sei.cmu.edu

In article <9007241309.AA00417@ajpo.sei.cmu.edu> GDAU100@BGUVM.BITNET ("Jonathan B. Owen") writes:
>
>1. When using TEXT_IO procedures and function without a file parameter,
>   STANDARD_INPUT and STANDARD_OUTPUT are used according to the
>   type of service (i.e. Get or Put, mainly).
>
>   Unlike the clarity of the above defaults, the SET_COL and COL
>   functions apply both to standard input and output.  As far as
>   I know, these services without a file parameter default to
>   STANDARD_OUTPUT.  Is this mentioned or defined in the LRM?

     Almost.  The LRM (14.3.4 (26)) says that the default is CURRENT_OUTPUT.
For the uninitiated, CURRENT_OUTPUT is the output file to be used when an
output file parameter is omitted in Text_IO.  At the beginning of execution
CURRENT_OUTPUT is STANDARD_OUTPUT, but CURRENT_OUTPUT can be changed by the
procedure SET_OUTPUT.

>2. When doing a Get_line, the user terminates input by pressing <CR>.
>   This moves the screen cursor to Col 1 of the following line (and
>   the COL counter of STANDARD_INPUT is updated accordingly).  Still,
>   the COL counter of STANDARD_OUTPUT remains as before.

     Very interesting.  I've verified that VAX Ada behaves the same way.
In a quick skim through the LRM I saw nothing that explicitly required
this behaviour.  (It could be there and I just missed it.)  In section
14.3.5 (3) is the statement "All procedures GET and PUT maintain the
current column, line, and page numbers of the specified file: ...".  I
wonder if implementors have jumped to the conclusion that only these
procedures, along with SET_LINE and SET_COL, can affect those numbers?
In looking at the titles of the 800+ issues considered by the ARG, it
appears that this question has never come up.  In the absence of an
explicit requirement to the contrary, I consider this to be a misimple-
mentation.  If your cursor is blinking at column 40 and you ask what
the column of STANDARD_OUTPUT is, any answer other than 40 is wrong.
(Even in the presence of an explicit requirement any answer other than
40 is wrong, but it just might not be possible to fix it.)

                              Charlie Sampson

  reply	other threads:[~1990-07-25 17:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-07-25  7:03 TEXT_IO anomality "Jonathan B. Owen"
1990-07-25 17:14 ` Charles H. Sampson [this message]
1990-07-26  6:54   ` Paul Hilfinger
1990-07-26 15:02     ` Vinod Grover
1990-07-28  1:20       ` Danford Lehman
1990-08-06 19:44     ` Charles H. Sampson
1990-08-13  9:32       ` Mike Harrison
  -- strict thread matches above, loose matches on Subject: below --
1990-07-26 14:32 "", Mats Weber
replies disabled

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