Version 1.5 of ais/ai-00050.txt

Unformatted version of ais/ai-00050.txt version 1.5
Other versions for file ais/ai-00050.txt

!standard A.10.3 (25)          99-08-31 AI95-00050/03
!standard A.14(03)
!standard A.10(05)
!class binding interpretation 95-06-25
!status Corrigendum 2000 99-05-24
!status WG9 approved 95-06-14
!status ARG approved 11-0-0 (by letter ballot) 96-06-05
!status ARG approved (subject to letter ballot) 9-0-0 95-11-01
!status received 95-06-25
!qualifier Error
!subject External files of Standard_Input and Standard_Output
!summary
Standard_Input, Standard_Output, and Standard_Error are associated with three distinct (internal) file objects. Their association with external files is not specified by the language; in particular, these three external files need not be distinct.
!question
A.14(2-3) says:
Operations on one text file object do not affect the column, line, and page numbers of any other file object.
Standard_Input and Standard_Output are associated with distinct external files, so operations on one of these files cannot affect operations on the other file. In particular, reading from Standard_Input does not affect the current page, line, and column numbers for Standard_Output, nor does writing to Standard_Output affect the current page, line, and column numbers for Standard_Input.
What is the intended meaning of the statement, "Standard_Input and Standard_Output are associated with distinct external files", given that the operating system may well consider standard input and standard output to be associated with the same device (say, a terminal)?
The NOTE in A.10.3(25) contradicts A.14(3):
24 The standard input, standard output, and standard error files are different file objects, but not necessarily different external files.
A.10(5-6) also discusses these files:
At the beginning of program execution the default input and output files are the so-called standard input file and standard output file. These files are open, have respectively the current modes In_File and Out_File, and are associated with two implementation-defined external files. Procedures are provided to change the current default input file and the current default output file.
At the beginning of program execution a default file for program-dependent error-related text output is the so-called standard error file. This file is open, has the current mode Out_File, and is associated with an implementation-defined external file. A procedure is provided to change the current default error file.
!recommendation
(See summary.)
!wording
Delete paragraph A.14(3).
!discussion
The NOTE in A.10.3(25) is correct. A.10(5-6) doesn't specifically say whether the external files are distinct. In any case, external files are "external" from the point of view of Ada semantics, so it's hard to see how one could write a test case that distinguishes whether the referenced statement is obeyed by an alleged implementation.
On most operating systems, it is possible for Standard_Input and Standard_Output to be associated with the same external file. This happens by default, when they are both associated with the same terminal device. It can also happen when the user redirects I/O to the same file.
It is not clear that A.14(3) is trying to say anything in addition to what A.14(2) already says for all text files. Therefore, A.14(3) should simply be removed.
!corrigendum A.14(03)
Delete the paragraph:
!ACATS test
This is essentially a permission to share the external device, which is not testable.
!appendix

!section A.7(01)
!section A.14(0)
!subject Reserved_128, etc.
!reference RM95-A.7(1)
!reference RM95-A.14
!from Keith Thompson 95-05-05
!reference as: 95-5137.a Keith Thompson 95-5-5>>
!discussion

A.14(3) says that
    "Standard_Input and Standard_Output are associated with distinct
    external files".

This is not necessarily true.  For example, in a typical Unix-based
implementation, both Standard_Input and Standard_Output may be associated
with the same tty device and have the same name ("/dev/pts/23"
or whatever).  In particular, A.7(1) says that "An external file is
identified by a string (the name)", implying that two external files
cannot have the same name, an unreasonable (and I presume unintended)
requirement for Standard_Input and Standard_Output.

Furthermore, the statement that they are associated with distinct external
files is not necessary to support the remainder of the paragraph, which
refers to effects on page, line, and column numbers.  These are presumably
properties of the file objects, not of the external file(s).

There should probably also be some mention of Standard_Error here.

****************************************************************

!section A.7(01)
!section A.14(0)
!subject File sharing, Standard_Input, Standard_Output
!reference RM95-A.7(1)
!reference RM95-A.14
!reference 95-5137.a Keith Thompson 95-5-5
!from Keith Thompson 95-05-05
!reference as: 95-5138.a Keith Thompson 95-5-6>>
!discussion

Oops!  In my previous comment (see the '!reference'), I incorrectly set
the '!subject' field to
    Reserved_128, etc.
instead of
    File sharing, Standard_Input, Standard_Output

(I was a little to quick with the ol' cut-and-paste.)

Please feel free to correct it in the database, if that's feasible.

****************************************************************

Questions? Ask the ACAA Technical Agent