Version 1.1 of ais/ai-00063.txt
!standard A.10.3 (23) 96-10-03 AI95-00063/04
!class binding interpretation 95-07-06
!status WG9 approved 96-12-07
!status ARG approved (letter ballot was 12-0-0) 96-10-03
!status ARG approved 8-0-1 (subject to letter ballot) 96-06-17
!status work item 95-07-06
!status received 95-07-06
!subject Erroneous execution for closing default files
An operation on a default file is erroneous if the corresponding file
object is closed at the time the operation is invoked.
23 If the Close operation is applied to a file object that is also serving
as the default input, default output, or default error file, then subsequent
operations on such a default file are erroneous.
This seems to imply that once the Close operation is done to, say, the
default output file, any further reference to the default output file is
erroneous, even if the default output file has been set to a different
(open) file. That is, closing a file that happens to be the default
output file poisons any reference to a different default output file.
Is this the intent? (No.)
Replace A.10.3(23) with the wording in the summary above.
The above interpretation makes the most sense -- it doesn't make sense
for a close to forever poison the default file. That is, if you close
the default file, and then reference that default file, it should be
erroneous, but if you close the default file, then reset the default
file to refer to some other open file, then it should not be erroneous
to then reference the default file.
In the above example, if there were no "Set_Output(File_2);", then
execution would be erroneous.
!subject After a default file is Closed ... ?
!from Dan Lehman 1995-03-22 [ or -06-28, re-sent]
!keywords subsequent operations, such a default file
!reference as: 95-5193.a Dan Lehman 95-6-28>>
If a close operation is applied to a file object that is also
serving as the default [,,,] file, then subsequent operations
on such a default file are erroneous.
Note that it doesn't say (exactly) "if the default [,,,] file is closed at
the time an operation is attempted, then an exception need not be raised
but the program is erroneous" or "... are erroneous unless it has been
(re-)set to an open file object"--i.e., the Close operation seemingly
forever taints the particular default file (though not the file object)!?
I.e., is the phrase "such a default" simply a shorthand reference to the
three possible default files, or was it intended to mean "a default file
that is currently set to a closed file object"?
Close (file_1); --A.10.3(23) antecedent
Set_Output (file_2); --?: a futile/pointless action after the Close?
Put (x); --A.10.3(23) consequent: erroneous?
By one interpretation, the (attempted?) setting of the default output file
to file_2 does not change the prior Close's effect on it and Put's being
erroneous. Is that the intended interpretation? (If so, there is one
ACVC 2.0 retained Ada83 test in need of repair.)
Questions? Ask the ACAA Technical Agent