Prefixes of attributes in length clauses 87-06-18 AI-00300/07 1 | !standard 13.02 (02) 87-06-18 AI-00300/07 | !class binding interpretation 84-10-16 | !status approved by WG9/AJPO 87-06-17 | !status approved by Director, AJPO 87-06-17 | !status approved by WG9 87-05-29 !status approved by Ada Board (21-0-0) 87-02-19 !status panel/committee-approved (11-1-1) 86-11 (by ballot) !status panel/committee-approved (4-1-0) 86-09-11 (pending letter ballot) !status work-item 86-07-24 !status received 84-10-16 !references 83-00453, 83-00636 !topic Prefixes of attributes in length clauses !summary 86-09-17 The prefix of the attribute that appears in a length clause must be a simple name. An expanded name, or the name T'BASE, is not allowed. !question 86-09-17 What is permissible as the prefix of an attribute in a length clause? Consider these forms: for T'SIZE use N; -- (1) for STANDARD.P.T'SIZE use N; -- (2) for T'BASE'SIZE use N; -- (3) Clearly (1) is allowed and, since (2) is harmless, it is presumably allowed, but is (3) intended to be allowed? Similarly, are length clauses with T'BASE'SMALL illegal? Are length clauses with T'BASE'STORAGE_SIZE legal (assuming T is a task type or non-derived access type) and synonymous with the similar length clause using T'STORAGE_SIZE? !recommendation 86-09-17 The prefix of the attribute that appears in a length clause must be a simple name. !discussion 86-09-17 The syntax for length clauses in 13.2(2) places no restriction on the form of prefix that can occur in the attribute. It thus appears that examples such as the following are allowed: Prefixes of attributes in length clauses 87-06-18 AI-00300/07 2 procedure PROC is type T is ...; for PROC.T'SIZE use ...; begin ... end; However, since 13.1(5) states: A representation clause and the declaration of the entity to which the clause applies must both occur immediately within the same declarative part, package specification, or task specification; ... it follows that any prefix in the prefix (e.g., PROC in the above example) can only be either the attribute T'BASE or an identifier or selected component that denotes the immediately containing unit. Allowing a selected component in the prefix of the attribute of a length clause: a) adds no expressive power (i.e., adds no functionality), b) is unlike other representation clauses and related pragmas, and c) does complicate the implementation. This was an unintended generality that resulted from the (convenient) use of the syntactic term attribute in the description of the length attribute. It was not intended to allow T'BASE as a prefix of the attribute that appears in a length clause, nor is it necessary to allow an expanded name as a prefix. The intent was to allow only a simple name as the prefix.