AI22-0156-1
!standard 3.6(26) 26-04-03 AI22-0156-1/03
!standard 3.10.2(10.5/5)
!standard 5.6.1(7/5)
!standard 13.13.1(18/5)
!class Presentation 26-02-11
!status Revision-202Y 26-02-20
!status ARG Approved 7-0-0 26-02-17
!status work item 26-02-11
!status received 26-01-10
!assigned author Randy Brukardt
!submitter Github handle mlemanowicz
!submitter Christoph Grein
!submitter Github handle Blady-Com
!submitter Tucker Taft
!priority Low
!difficulty Easy
!subject Minor presentation issues
Several presentation issues are fixed.
(1)
In 13.13.1(18/5), the Preelaborate aspect is misspelled:
package Ada.Streams.Storage.Unbounded
with Prelaborated, Nonblocking, Global => in out synchronized
is
(2)
3.6(26):
type Matrix is array(Integer range <>, Integer range <>) of Real;
4.3.3(47/5):
Empty_Matrix : constant Matrix := []; -- A matrix without elements
The declaration of Empty_Matrix will raise Constraint_Error.
(3)
The example of a parallel block statement in 5.6.1 makes calls with components that the object T does not have. There is a condition to ensure that the underlying type has the components, but the needed type conversion is missing.
(4)
It seems that “that of” is missing from the following sentence from 3.10.2(10/5):
(1) Correct the spelling to “Preelaborate”.
(2) The index subtypes should be Positive in type Matrix.
(3) The parallel calls to T should have a type conversion and explicit dereference.
(4) Add the “that of”.
Modify 3.6(26) in part:
type Matrix is array({Positive}[Integer] range
<>,
{Positive}[Integer] range <>) of Real;
Modify 3.10.2(10.5/5):
Modify 5.6.1(7/5):
procedure Traverse (T : Expr_Ptr) is -- see 3.9.1
begin
if T /= null and then
T.all in Binary_Operation'Class -- see 3.9.1
then -- recurse down the binary tree
parallel do
Traverse
({Binary_Operation’Class(T.all)}[T].Left);
and
Traverse
({Binary_Operation’Class(T.all)}[T].Right);
and
Ada.Text_IO.Put_Line
("Processing " & Ada.Tags.Expanded_Name
(T'Tag));
end do;
end if;
end Traverse;
Modify 13.13.1(18/5):
package Ada.Streams.Storage.Unbounded
with {Preelaborate}[Prelaborated], Nonblocking,
Global => in out synchronized is
For issue (2), all of the uses of Matrix in other examples were checked, and they all used ranges with a lower bound of 1, so this change does not introduce any other errors.
For issue (3), there are other fixes possible, but the one chosen is the only one that doesn’t require some sort of extra declaration. (The author notes that these sorts of conversions are very common in his OOP code.)
@drepl
@xcode{@b{type} Vector @b{is} @b{array}(Integer @b{range} <>) @b{of} Real;
@b{type} Matrix @b{is} @b{array}(Integer @b{range} <>, Integer @b{range} <>) @b{of} Real;
@b{type} Bit_Vector @b{is} @b{array}(Integer @b{range} <>) @b{of} Boolean;
@b{type} Roman @b{is} @b{array}(Positive @b{range} <>) @b{of} Roman_Digit; --@ft{@i{ see @Ref{3.5.2}}}}
@dby
@xcode{@b{type} Vector @b{is} @b{array}(Integer @b{range} <>) @b{of} Real;
@b{type} Matrix @b{is} @b{array}(Positive @b{range} <>, Positive @b{range} <>) @b{of} Real;
@b{type} Bit_Vector @b{is} @b{array}(Integer @b{range} <>) @b{of} Boolean;
@b{type} Roman @b{is} @b{array}(Positive @b{range} <>) @b{of} Roman_Digit; --@ft{@i{ see @Ref{3.5.2}}}}
@drepl
@xinbull{If the call itself defines the result of a function @i{F}, or has an accessibility level that is tied to the result of such a function @i{F}, then the master of the call is that of the master of the call invoking @i{F};}
@dby
@xinbull{If the call itself defines the result of a function @i{F}, or has an accessibility level that is tied to that of the result of such a function @i{F}, then the master of the call is that of the master of the call invoking @i{F};}
@drepl
@xcode{@b{procedure} Traverse (T : Expr_Ptr) @b{is} --@FT{@I{ see @ref{3.9.1}}}
@b{begin}
@b{if} T /= @b{null} @b{and} @b{then}
T.@b{all} @b{in} Binary_Operation'Class --@FT{@I{ see @ref{3.9.1}}}
@b{then} --@FT{@I{ recurse down the binary tree}}
@b{parallel do}
Traverse (T.Left);
@b{and}
Traverse (T.Right);
@b{and}
Ada.Text_IO.Put_Line
("Processing " & Ada.Tags.Expanded_Name (T'Tag));
@b{end do};
@b{end if};
@b{end} Traverse;}
@dby
@xcode{@b{procedure} Traverse (T : Expr_Ptr) @b{is} --@FT{@I{ see @ref{3.9.1}}}
@b{begin}
@b{if} T /= @b{null} @b{and} @b{then}
T.@b{all} @b{in} Binary_Operation'Class --@FT{@I{ see @ref{3.9.1}}}
@b{then} --@FT{@I{ recurse down the binary tree}}
@b{parallel do}
Traverse (Binary_Operation’Class(T.@b{all}).Left);
@b{and}
Traverse (Binary_Operation’Class(T.@b{all}).Right);
@b{and}
Ada.Text_IO.Put_Line
("Processing " & Ada.Tags.Expanded_Name (T'Tag));
@b{end do};
@b{end if};
@b{end} Traverse;}
@drepl
@xcode{@b{package} Ada.Streams.Storage.Unbounded
@b{with} Prelaborated, Nonblocking, Global => @b{in out synchronized} @b{is}}
@dby
@xcode{@b{package} Ada.Streams.Storage.Unbounded
@b{with} Preelaborate, Nonblocking, Global => @b{in out synchronized} @b{is}}
(1) No test is needed for a misspelling in a language-defined package (one presumes that there is a test objective somewhere that the aspect applies).
(2) No test is needed for an example.
(3) No test is needed for an example.
(4) No change in meaning is meant here, any existing tests should remain correct.
Item (1) comes from Github Issue #165.
Item (2) comes from Github Issue #164.
Item (3) comes from Github Issue #159.
Item (4) comes from Github Issue #155.