!standard A.10.3 (23) 00-04-11 AI95-00063/06 !class binding interpretation 95-07-06 !status Corrigendum 2000 99-05-24 !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 !qualifier Error !subject Erroneous execution for closing default files !summary An operation on a default file is erroneous if the corresponding file object is closed at the time the operation is invoked. !question 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.) Consider: Set_Output(File_1); Close(File_1); Set_Output(File_2); Put(X); -- Erroneous? (No.) !recommendation (See summary.) !wording Replace A.10.3(23) with the wording in the summary above. !discussion 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. !corrigendum A.10.03(22) @drepl The execution of a program is erroneous if it attempts to use a current default input, default output, or default error file that no longer exists. @dby The execution of a program is erroneous if it invokes an operation on a current default input, default output, or default error file if the corresponding file object is closed or no longer exists. !corrigendum A.10.03(23) @ddel 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. !ACATS test The ACATS test CE3902B prompted the AI. It resembles the example in the question and tests this rule effectively. !appendix !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>> !discussion 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"? Consider: 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.) ---Dan ------- * ****************************************************************