Version 1.1 of ai12s/ai12-0308-1.txt

Unformatted version of ai12s/ai12-0308-1.txt version 1.1
Other versions for file ai12s/ai12-0308-1.txt

!standard 3.1(6/3)          19-02-05 AI12-0308-1/01
!standard 3.3(6)
!standard 3.3(18.1/3)
!standard 5.5.3(0)
!reference AI12-0189-1
!reference AI12-0212-1
!reference AI12-0251-1
!class Amendment 19-02-05
!status Amendment 1-2012 19-02-05
!status work item 19-02-05
!status received 19-01-21
!priority Low
!difficulty Easy
!subject New entities that are declarations need to be references in 3.1 and 8.1.
!summary
Make sure that all declarations are mentioned in 3.1, and every declarative region is mentioned in 8.1.
!problem
Various AIs have defined new kinds of declarations without adding them to the list of possible declaration in 3.1 and in some cases without adding them to the list of declarive regions in 8.1. Moreover, the parameter names declared for procedural iterators aren't even treated as declarations in their own specification -- but somehow those names become visible. Finally, the parameter of a chunk_specification should be an object and constant.
!proposal
(See Summary.)
!wording
Modify 3.1(6/5):
Each of the following is defined to be a declaration: any basic_declaration; an enumeration_literal_specification; a discriminant_specification; a component_declaration; {a defining_identifier of }an iterated_component_association; a loop_parameter_specification; {a defining_identifier of a chunk_specification;} an iterator_specification; {a defining_identifier of an iterator_parameter_specification; }a parameter_specification; a subprogram_body; an extended_return_object_declaration; an entry_declaration; an entry_index_specification; a choice_parameter_specification; a generic_formal_parameter_declaration.
[Editor's notes: These are given in the order that they appear in the Standard. We don't need iterator_element_specification here as it contains loop_parameter_specification or iterator_specification, which are both here. We need to add the defining_identifier of an iterated_component_association so we aren't covering these with iterator_specifications. Similarly, we only are interested in the defining_identifier of a chunk_specification.]
Add after 3.3(6) (as a bulleted list item):
- the chunk parameter of a chunk_specification;
Add after 3.3(18.1/3) (as a bulleted list item):
- the chunk parameter of a chunk_specification;
Add ", chunk_specification" in the comment-separated list of 3.3.1(23/3), immediately after ", iterator_component_association".
Replace 5.5.3(3/5) with:
iterator_parameter_specification ::= formal_part | (defining_identifier{, defining_identifier})
Modify 5.5.3(13/5):
The anonymous access-to-procedure type /A/ shall have at least one formal parameter in its parameter profile. If the iterator_parameter_specification is a formal_part, then this formal_part shall be mode conformant with that of /A/. If the iterator_parameter_specification is a list of {defining_}identifiers, the number of formal parameters of /A/ shall be the same as the length of this list.
Modify 5.5.3(15/5):
A loop_statement with an iteration_scheme that has a procedural_iterator is equivalent to a local declaration of a procedure P followed by a procedure_call_statement that is formed from the iterator_procedure_call by replacing the <> of the parameter_association_with_box with P'Access.
The formal_part of the locally declared procedure P is formed from the
formal_part of the anonymous access-to-procedure type /A/, by replacing the identifier of each formal parameter of this formal_part with the identifier of the corresponding formal parameter or element of the list of {defining_}identifiers given in the iterator_parameter_specification.
Add after 8.1(2.1/4):
* an iterated_component_association; * an iterated_element_association; * a quantified_expression; * a declare_expression;
[Editor's note: These are given in the order they appear in the RM, except that we messed that up by misplacing quantified_expression and more recently with declare_expression and iterated_component_assocation; I've moved all of them to fix that.]
Delete 8.1(4.1/4) (which was misplaced).
!discussion
All of these changes are needed to keep the wording for new features consistent with that for existing features.
!corrigendum 3.1(6/3)
Replace the paragraph:
Each of the following is defined to be a declaration: any basic_declaration; an enumeration_literal_specification; a discriminant_specification; a component_declaration; a loop_parameter_specification; an iterator_specification; a parameter_specification; a subprogram_body; an extended_return_object_declaration; an entry_declaration; an entry_index_specification; a choice_parameter_specification; a generic_formal_parameter_declaration.
by:
Each of the following is defined to be a declaration: any basic_declaration; an enumeration_literal_specification; a discriminant_specification; a component_declaration; a defining_identifier of an iterated_component_association; a loop_parameter_specification; a defining_identifier of a chunk_specification; an iterator_specification; a defining_identifier of an iterator_parameter_specification; a parameter_specification; a subprogram_body; an extended_return_object_declaration; an entry_declaration; an entry_index_specification; a choice_parameter_specification; a generic_formal_parameter_declaration.
!corrigendum 3.3(6)
Insert after the paragraph:
the new paragraph:
!corrigendum 3.3(18.1/3)
Insert after the paragraph:
the new paragraph:
!corrigendum 3.3.1(23/3)
Replace the paragraph:
8 As indicated above, a stand-alone object is an object declared by an object_declaration. Similar definitions apply to "stand-alone constant" and "stand-alone variable." A subcomponent of an object is not a stand-alone object, nor is an object that is created by an allocator. An object declared by a loop_parameter_specification, iterator_specification, parameter_specification, entry_index_specification, choice_parameter_specification, extended_return_statement, or a formal_object_declaration of mode in out is not considered a stand-alone object.
by:
8 As indicated above, a stand-alone object is an object declared by an object_declaration. Similar definitions apply to "stand-alone constant" and "stand-alone variable." A subcomponent of an object is not a stand-alone object, nor is an object that is created by an allocator. An object declared by a loop_parameter_specification, iterator_specification, iterated_component_association, chunk_specification, parameter_specification, entry_index_specification, choice_parameter_specification, extended_return_statement, or a formal_object_declaration of mode in out is not considered a stand-alone object.
!corrigendum 5.5.3(0)
Insert new clause:
Just a fake; the actual wording is in the conflict file.
!corrigendum 8.1(2.1/4)
Insert after the paragraph:
the new paragraphs:
!corrigendum 8.1(4.1/4)
Delete the paragraph:
!ASIS
No ASIS changes needed.
!ACATS test
No separate ACATS tests needed.
!appendix

From: Randy Brukardt
Sent: Monday, January 21, 2019  11:15 PM

> > Vaguely related question:
> > 
> > Procedural iterators in 5.5.3 use a similar formulation. 
> > Should they have these same fixes (identifier => 
> > defining_identifier, and adding to the 3.1 list)?? They don't have 
> > conformance issues, but it seem odd to use a name in an expression 
> > without ever having a declaration for it. (I'd have to put that in a 
> > separate AI.)
> > 
> > Also, I note "iterated_component_association" here. Shouldn't the 
> > container aggregate "iterated_element_association" also appear here 
> > (3.1(6/5))?? Note that that can matter to conformance. I don't see 
> > that in AI12-0212-1 (which I haven't gotten into the draft RM yet).
> 
> "chunk_specification" also declares an object that isn't mentioned in 
> 3.1(6/5), either. So that too (three?? ;-) should be added, right?

I also note that iterated_component_association is in 8.1, defining a 
declarative region. More likely, iterated_element_association also needs
to be in 8.1. (A chunk_specification would share the declarative region 
with the enclosing loop_statement, so it doesn't need to be in 8.1. The 
same probably applies to procedural iterators.) 

This is mostly a note so I don't forget these things should I ever get 
around to making a fix-up AI.

****************************************************************

From: Tucker Taft
Sent: Tuesday, January 22, 2019  2:43 PM

> I also note that iterated_component_association is in 8.1, defining a 
> declarative region. More likely, iterated_element_association also needs
> to be in 8.1. (A chunk_specification would share the declarative region 
> with the enclosing loop_statement, so it doesn't need to be in 8.1. The 
> same probably applies to procedural iterators.) 

Makes sense.

****************************************************************

Questions? Ask the ACAA Technical Agent