CVS difference for ais/ai-00381.txt
--- ais/ai-00381.txt 2004/06/10 05:39:58 1.2
+++ ais/ai-00381.txt 2004/07/27 23:01:07 1.3
@@ -1,5 +1,8 @@
-!standard 13.12.1 (0) 04-06-08 AI95-00381/01
+!standard 13.12 (4) 04-06-17 AI95-00381/02
+!standard 13.12.1 (1)
!class amendment 04-06-08
+!status Amendment 200Y 04-06-29
+!status ARG Approved 11-0-1 04-06-17
!status work item 04-06-08
!status received 04-06-08
!priority Medium
@@ -14,8 +17,8 @@
!problem
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
+dependence on one language-defined package or another. Rather than
+adding more of these identifiers piece-meal, it would make sense to
have a general No_Dependence restriction, identifying the restricted
package by the expression associated with the restriction.
@@ -25,8 +28,15 @@
!wording
-New section 13.12.1:
+ Change 13.12(4) to:
+ restriction ::= restriction_identifier
+ | restriction_parameter_identifier => restriction_parameter_argument
+
+ restriction_parameter_argument ::= name | expression
+
+ New section 13.12.1:
+
13.12.1 Restriction No_Dependence
Static Semantics
@@ -34,54 +44,68 @@
The following restriction_parameter_identifier is language defined:
No_Dependence
- Specifies a language-defined or implementation-defined
- library unit on which there are no semantic dependences.
+ Specifies a language-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
- type Standard.String.
-
- Legality Rules
- 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.
+ The restriction_parameter_argument of a No_Dependence restriction shall be
+ a name that corresponds to the full expanded name of a language-defined library unit.
Post-Compilation Rule
No compilation unit included in the partition shall depend semantically
- on the library unit identified by the static string expression.
+ on the library unit identified by the name.
!discussion
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.
+We considered using a static string identify the library unit, as this
+would allow a "wildcard" notation (like "Ada.Wide_*"), and would require less
+changes to the existing language. But it was just too unnatural.
!example
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
-
!ACATS test
An ACATS test should be created for this pragma.
+
+!corrigendum 13.12(4)
+
+@drepl
+@xcode<@fa<restriction ::= >@ft<@i<restriction>>@fa<_identifier
+ | >@ft<@i<restriction_parameter>>@fa<_identifier =@> expression>>
+@dby
+@xcode<@fa<restriction ::= >@ft<@i<restriction>>@fa<_identifier
+ | >@ft<@i<restriction_parameter>>@fa<_identifier =@> restriction_parameter_argument>
+
+restriction_parameter_argument ::= name | expression>
+
+!corrigendum 13.12.1(1)
+
+@dinsc
+@i<@s8<Static Semantics>>
+
+The following @i<restriction_parameter>@fa<_identifier> is language defined:
+
+@xhang<@xterm<No_Dependence>
+Specifies a language-defined library unit on which there are no semantic dependences.>
+
+@i<@s8<Name Resolution Rules>>
+
+The @fa<restriction_parameter_argument> of a No_Dependence restriction shall be
+a name that corresponds to the full expanded name of a language-defined
+library unit.
+
+@i<@s8<Post-Compilation Rules>>
+
+No compilation unit included in the partition shall depend semantically
+on the library unit identified by the @fa<name>.
!appendix
Questions? Ask the ACAA Technical Agent