Version 1.1 of ais/ai-00381.txt
!standard 13.12.1 (0) 04-06-08 AI95-00381/01
!class amendment 04-06-08
!status work item 04-06-08
!status received 04-06-08
!subject New Restrictions identifier No_Dependence
A new Restrictions identifier is proposed to specify that there are no
dependences on a given language-defined or implementation-defined package.
There are a number of Restrictions identifiers provided for disallowing
dependence on one language-defined package or another. Rather than
adding more of these identifiers piece-meal, it would seem to make sense to
have a general No_Dependence restriction, identifying the restricted
package by the expression associated with the restriction.
New section 13.12.1:
13.12.1 Restriction No_Dependence
The following restriction_parameter_identifier is language defined:
Specifies a language-defined or implementation-defined
library unit on which there are no semantic dependences.
Name Resolution Rules
The expression of a No_Dependence restriction is expected to be of
The expression of a No_Dependence restriction shall be a static
string expression. The value of the string shall correspond (in
upper, lower, or mixed case) to the full expanded name of a
language-defined or implementation-defined library unit.
No compilation unit included in the partition shall depend semantically
on the library unit identified by the static string expression.
This restriction should reduce the need for having a separate restriction
identifier for each potentially interesting language-defined library unit.
We considered using a name rather than a static string to identify the
library unit, but the name could not be construed as an expression
of any actual type, and the basic syntax of pragma Restrictions specifies
the use of an expression after a restriction_parameter_identifier.
Furthermore, using a name in some sense implies a dependence on the named
unit, whereas the whole point is to avoid any dependence. A static string
seems to have the right semantics for this purpose.
We could also consider supporting some kind of "wildcard" notation,
such as "Ada.Wide_*". This would clearly depend on using a string
rather than a name for the argument.
pragma Restrictions(No_Dependence => "Ada.Command_Line");
-- Example of restriction on language-defined package
pragma Restrictions(No_Dependence => "System.RTS.Tasking");
-- Example of restriction on implemenation-defined package
An ACATS test should be created for this pragma.
Questions? Ask the ACAA Technical Agent