AI22-0087-1

!standard A.4.12(31/5)                                        24-04-24  AI22-0087-1/04

!class binding interpretation 22-12-07

!status Amendment 1-2022  23-12-14

!status WG9 Approved 24-06-10

!status ARG Approved  10-0-1  23-12-14

!status work item 23-12-07

!status received 23-09-26

!submitter Tucker Taft

!priority Low

!difficulty Easy

!qualifier Omission

!subject Text buffers are initially empty

!summary

Text buffers are initially empty unless otherwise initialized. Remove wording mentioning Character_Count, since it is no longer defined in the package.

!issue

(1) Nothing in A.4.12 describes the initial state of a text buffer. A.4.12(34/5) says that a buffer is "reset to an empty state, with no stored characters" after a call to one of the Get functions, but nothing is said about the initial state.

(2) A.4.12(31/5) and an associated note talks about a Character_Count function, but no such thing is defined.

!recommendation

(See summary.)

!wording

Replace A.4.12(31/5) with:

If an object of a text buffer type is not otherwise initialized, it is initialized to the empty state, with no stored characters.

Delete AARM A.4.12(31.a/5).

!discussion

It would have been better to have an Is_Empty function in the text buffers, and include that in the Default_Initial_Condition, but it seems unnecessarily disruptive to add a function to this package now for this rather trivial issue.

Note that the use of text buffers to implement the Image attribute combined with the requirements on the result of the Image attribute (particularly for compatibility reasons), mean that the buffers have to be empty on initialization. One could apply the Dewar Rule, but it is better to be explicit.

!corrigendum A.4.12(31/5)

@drepl

Character_Count returns the number of characters currently stored in a text buffer.

@dby

If an object of a text buffer type is not otherwise initialized, it is initialized to the empty state, with no stored characters.

!ACATS test

No additional ACATS test should be needed, any test of text buffers will assume an empty initial state.

!appendix

See issue #62 on ARG GitHub issue list.