Version of ais/ai-00063.txt

Unformatted version of ais/ai-00063.txt version
Other versions for file 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
!priority Low
!difficulty Medium
!subject Erroneous execution for closing default files
!summary 95-07-06
An operation on a default file is erroneous if the corresponding file object is closed at the time the operation is invoked.
!question 96-07-23
A.10.3(23) states:
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.)
Set_Output(File_1); Close(File_1); Set_Output(File_2); Put(X); -- Erroneous? (No.)
!recommendation 96-07-23
(See summary.)
!wording 96-07-23
Replace A.10.3(23) with the wording in the summary above.
!discussion 96-07-23
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.

!section A.10.3(23)
!subject After a default file is Closed ... ?
!reference RM95-A.10.3(23)
!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>>

   A.10.3(23) states:

     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"?


    Set_Output (file_1);
    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