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

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

!standard 3.3.1(31/2)          21-05-27 AI12-0430-1/01
!standard 3.6.1(13)
!standard 3.8(27)
!standard 3.8.1(25)
!standard 4.3.5(62/5)
!standard 4.3.5(92/5)
!standard 4.3.5(93/5)
!standard 9.4(31)
!class presentation 21-05-24
!status Amendment 1-2012 21-05-24
!status work item 21-05-24
!status received 20-05-24
!priority Low
!difficulty Easy
!qualifier Omission
!subject Example issues from WG 9 review
!summary
Various issues with examples were noted by WG 9 reviewers of Draft 29 of the RM.
!question
We need to fix issues noted in the examples, right? (Yes.)
!recommendation
(See summary.)
!wording
[Editor's note: These changes have been applied to Draft 30 of the RM, even though they are not yet approved, as they are not expected to need changes.]
In 3.3.1(31/2) add "-- see 3.6" for Bit_Vector.
In 3.6.1(13) add "-- see 3.6" for Bit_Vector.
In 3.8 (27) add "-- see 3.5.1" for Month_Name.
In 3.8.1(25), properly align "end case" and "end record". [Note: This was copied incorrectly from the Ada 83 RM, and is wrong in all versions of Ada since, starting with Ada 9x 2.0 (the first version with examples) and continuing to the present.]
In 4.3.5(62/5), replace Count_Type with Integer.
Delete 4.3.5(92/5) and 4.3.5(93/5).
[Editor's note: These examples are illegal as written as the Map_Type they use does not declare iterators. Doing that would require four new aspects and three new subprograms, which is quite complex and would obscure (further) the point of this example. Perhaps there is some other type in the RM that could be used, or maybe an example container type should be declared somewhere else (perhaps in 5.5.2) for this purpose. That sort of major example change is deferred to a future language update.]
In 4.5.8(12/3), modify "... a positive number {N} is composite ..."
In 9.4(31), "return" and "others" should be bold.
!discussion
(See !summary.)
!corrigendum 3.3.1(31/2)
Replace the paragraph:
Count, Sum : Integer; Size : Integer range 0 .. 10_000 := 0; Sorted : Boolean := False; Color_Table : array(1 .. Max) of Color; Option : Bit_Vector(1 .. 10) := (others => True); Hello : aliased String := "Hi, world."; θ, φ : Float range -π .. +π;
by:
Count, Sum : Integer; Size : Integer range 0 .. 10_000 := 0; Sorted : Boolean := False; Color_Table : array(1 .. Max) of Color; Option : Bit_Vector(1 .. 10) := (others => True); -- see 3.6 Hello : aliased String := "Hi, world."; θ, φ : Float range -π .. +π;
!corrigendum 3.6.1(13)
Replace the paragraph:
Filter : Bit_Vector(0 .. 31);
by:
Filter : Bit_Vector(0 .. 31); -- see 3.6
!corrigendum 3.8(27)
Replace the paragraph:
type Date is record Day : Integer range 1 .. 31; Month : Month_Name; Year : Integer range 0 .. 4000; end record;
by:
type Date is record Day : Integer range 1 .. 31; Month : Month_Name; -- see 3.5.1 Year : Integer range 0 .. 4000; end record;
!comment no corrigendum section for simple whitespace changes as in 3.8.1(25);
!comment the editor is empowered to just make those.
!corrigendum 4.3.5(0)
Insert new clause:
See the conflict file for the changes.
!corrigendum 4.5.8(12/3)
Replace the paragraph:
The assertion that a positive number is composite (as opposed to prime) can be written:
by:
The assertion that a positive number N is composite (as opposed to prime) can be written:
!corrigendum 9.4(31)
Replace the paragraph:
protected Shared_Array is -- Index, Item, and Item_Array are global types function Component (N : in Index) return Item; procedure Set_Component(N : in Index; E : in Item); private Table : Item_Array(Index) := (others => Null_Item); end Shared_Array;
by:
protected Shared_Array is -- Index, Item, and Item_Array are global types function Component (N : in Index) return Item; procedure Set_Component(N : in Index; E : in Item); private Table : Item_Array(Index) := (others => Null_Item); end Shared_Array;
!ASIS
No ASIS effect.
!ACATS test
No ACATS tests should be needed, none of these changes change any semantics.
!appendix

From the WG 9 review, Issue #25

3.3.1 (31/2) Add a "-- see 3.6" for Bit_Vector.

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

From the WG 9 review, Issue #31

3.6.1 (13) Add a "-- see 3.6" for Bit_Vector.

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

From the WG 9 review, Issue #33

3.8 (27) Add a "-- see 3.5.1" for Month_Name.

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

From the WG 9 review, Issue #61

9.4 (31) return and others should be bold.

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

From the WG 9 review, Issue #166

This example assumes that Map_Type has iterator aspects, which are not shown 
in its earlier declaration. Perhaps a comment should be added to this effect 
to avoid confusion.

[Reply from editor:]
Agreed. I'm tempted to delete 4.3.5(92/5) and 4.3.5(93/5), even though they 
are useful examples, because they violate our design principles for examples
(in that they be compilable without "magic"). Defining the four needed aspects
to support "of" iteration would really hide the purpose of these examples.

The only alternative I can think of would be to somehow depend on the A.18.33 
example for these iterators - but I'm not sure how to do that.

[Reply from Tucker Taft:]
At this point I would suggest we do one of the following:

    delete the two bullets; or
    add a comment saying "-- This presumes the Map type has the necessary aspects
        to permit iteration -- see A.18.5 for an example of these aspects"; or
    do nothing -- defer to next revision cycle.

I think I favor the last choice.

[Reply from editor:]
I prefer splitting the baby: deleting the two paragraphs now (in AI12-0430-1),
but deferring this issue to revisit it in the future (perhaps we should create
a proper container-like iterator example somewhere, maybe 5.5.2, and if we did
that we could use it here). I think we should delete the paragraphs now
because incorrect examples can cause major confusion, particularly in this 
case when we're illustrating the use of iterators -- they really need to be 
properly declared so it doesn't appear that the compiler is conjuring them 
out of thin air.

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

From the WG 9 review, Issue #53 - Pat Rogers

please vertically align end case with case and end record with record.

[Editor's Reply:]

This was wrong in the Ada 95 RM (I looked at my printed presentation copy), 
and presumably I carefully copied the mistake when creating the Consolidated
version in 1998 (I did that with all of the errors in the Ada 95 RM). In fact,
this example was copied from the Ada 83 RM (in which it is spaced correctly),
but every version of the Ada 9x RM that had an example (all the way back to 
version 2.0 of March 1993!) has the incorrect spacing. Amazing that no one 
complained for 28.2 years!!

Because of the age, I mentioned this in the example AI (even though we don't 
normally track whitespace changes).

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

From the WG 9 review, Issue #58 - Pat Rogers

4.5.8 (12/3) The assertion that a positive number {N} is composite ...

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

Questions? Ask the ACAA Technical Agent