Version 1.2 of ai05s/ai05-0204-1.txt

Unformatted version of ai05s/ai05-0204-1.txt version 1.2
Other versions for file ai05s/ai05-0204-1.txt

!standard A.4.4(3)          10-02-15 AI05-0204-1/01
!standard A.4.5(3)
!standard A.4.5(7)
!standard A.4.5(75)
!class amendment 10-02-15
!status work item 10-02-15
!status received 09-12-16
!priority Low
!difficulty Easy
!subject String packages should be Remote_Types
!summary
Make Ada.Strings.Bounded and Ada.Strings.Unbounded remote_Types.
!problem
The string packages Ada.Strings.Bounded and Ada.Strings.Unbounded export types that could commonly be used in distribution programs. However, the packages are not defined to be Remote_Types packages and thus they cannot be used for entities that get communicated between partitions.
This should be changed.
!proposal
(See wording.)
!wording
Add pragma Remote_Types(Bounded); to A.4.4(3).
Add pragma Remote_Types(Unbounded); to A.4.5(3).
Delete A.4.5(7) and A.4.5(75).
!discussion
Ada.Strings.Fixed doesn't export any types, so it doesn't need to be a Remote_Types package. It could be if we wanted consistency, although that wouldn't add any significant capability.
Remote_Types categorization is incompatible with type String_Access in Ada.Strings.Unbounded. Since this type isn't used elsewhere in the visible part of the package (other than in procedure Free), it is an orphan and probably should never have been in the package in the first place. Thus we delete it and the procedure Free. This will have a minor compatibility impact (minor because the type is rarely used), which is easily fixed by adding the appropriate declarations somewhere in the user's code.
These categorizations were considered in AI95-0126-1. At that time, Ada.Strings.Maps was a Preelaborable package, and that prevented these packages from being Remote_Types. Later AI95-0362-1 changed the categorization of Ada.Strings.Maps because of relaxations in Pure categorization, but that AI claimed "and there are not any proposed changes that would change the results of [AI-126]", which was clearly not true.
If the implementation does not support Annex E features, then pragma Remote_Types can be omitted by a permission added by AI05-0060-1.
[Note: AI05-0206-1 provides a partial alternative to making this change.]
--!corrigendum A.4.4(3)
!ACATS test
Create an ACATS C-Test to test that the packages can be used as Remote_Types packages.
!appendix

From: Vadim Godunko
Sent: Wednesday, December 16, 2009  2:21 PM

In context of use Distributed System Annex it would be useful to categorize the
package Ada.Strings.Unbounded as Remote_Types. Why it is not categorized as
Remote_Types now?

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

From: Thomas Quinot
Sent: Friday, December 18, 2009  7:06 AM

At least one reason is that it contains the declaration of an access type in its
visible part. This is (quite unfortunate and) incompatible with the restrictions
on remote access types).

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

From: Randy Brukardt
Sent: Friday, December 18, 2009  1:59 PM

More than unfortunate: the type is never used in the spec and so far as I can
tell has nothing to do with the unbounded string type.

We should consider deleting that access type and making the package Remote_Types
(probably similarly to the way it was done for the containers, with a permission
to ignore it if Annex E isn't supported). (Unless there is some other reason it
cannot be Remote_Types).

But note that the other two String packages also ought to be made Remote_Types
in that case (it would be weird for unbounded strings to have more capability
than bounded strings). Note sure if there is a problem with that.

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

From: Stephen Leake
Sent: Friday, December 18, 2009  2:31 PM

If we do that, I suggest moving the type declaration to Standard; it is
convenient to have a standard common access type for String.

On the other hand, that might be a worse backward incompatibility than just
deleting the type.

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

From: Thomas Quinot
Sent: Saturday, December 19, 2009  5:17 AM

> We should consider deleting that access type and making the package
> Remote_Types (probably similarly to the way it was done for the
> containers, with a permission to ignore it if Annex E isn't
> supported). (Unless there is some other reason it cannot be Remote_Types).

Agreed.

> But note that the other two String packages also ought to be made
> Remote_Types in that case (it would be weird for unbounded strings to
> have more capability than bounded strings). Note sure if there is a
> problem with that.

Agreed for Bounded. Things are different for Fixed, since Fixed's string type is
Standard.String, which has no distribution categorization issues.

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

Questions? Ask the ACAA Technical Agent