CVS difference for ais/ai-00345.txt

Differences between 1.12 and version 1.13
Log of other versions for file ais/ai-00345.txt

--- ais/ai-00345.txt	2004/04/06 21:50:50	1.12
+++ ais/ai-00345.txt	2004/07/27 23:01:00	1.13
@@ -1,5 +1,27 @@
-!standard  3.04.03    (00)                             04-03-31  AI95-00345/05
+!standard  3.09.01    (03)                             04-07-02  AI95-00345/06
+!standard  2.09       (03)
+!standard  3.09.03    (01)
+!standard  3.09.03    (02)
+!standard  3.09.04    (01)
+!standard  6.03.01    (24)
+!standard  9.01       (02)
+!standard  9.01       (08)
+!standard  9.01       (09.1/1)
+!standard  9.04       (02)
+!standard  9.04       (10)
+!standard  9.04       (11)
+!standard  9.07.02    (01)
+!standard  9.07.02    (03)
+!standard  9.07.02    (04)
+!standard  9.07.04    (04)
+!standard  9.07.04    (06)
+!standard  9.08       (03)
+!standard  9.09       (01)
+!standard 12.05.05    (01)
+!standard 12.06       (09)
 !class amendment 03-08-07
+!status Amendment 200Y 04-07-02
+!status ARG Approved 11-0-1  04-06-17
 !status work item 03-09-28
 !status received 03-06-12
 !priority Medium
@@ -47,16 +69,23 @@
 AI-251 or AI-252 wording.
 
 
-Modify the first sentence of 3.9.1(1):
+In 2.9(3) as modified by AI-284 add the following to the list of nonreserved
+keywords
 
+       synchronized
+
+Modify the first sentence of 3.9.1(3):
+
     The parent type of a record extension shall not be a class-wide type {nor
     shall it be a synchronized tagged type (see 3.9.4)}.
 
-Replace 3.9.3(1-2) with:
+Replace the first sentence of 3.9.3(1) with:
 
     An abstract type is a type intended for use as an ancestor of
     other types, but which is not allowed to have objects of its own.
 
+Replace 3.9.3(2) with:
+
         Static semantics
 
     Interface types (see 3.9.4) are abstract types. In addition, a
@@ -197,8 +226,8 @@
         that of the inherited subprogram after omitting this first parameter;
         in this case the inherited subprogram is said to be *implemented* by
         the conforming protected subprogram or entry, and its profile after
-        omitting the first (and second) parameter shall be subtype conformant
-        with that of the protected subprogram or entry.
+        omitting the first parameter shall be subtype conformant with that of
+        the protected subprogram or entry.
 
     If neither applies, the inherited subprogram shall be a null procedure.
 
@@ -239,10 +268,16 @@
 
     If a procedure_call_statement is used for a procedure_or_entry_call,
     and the procedure is implemented by an entry, then the procedure_name,
-    or the procedure_prefix and possibly one of the parameters of
+    or the procedure_prefix and possibly the first parameter of
     the procedure_call_statement, determine the target object of the call
     and the entry to be called.
 
+    AARM Note:
+    The above says "possibly the first parameter", because Ada allows entries
+    to be renamed and passed as formal subprograms. In those cases, the
+    task or protected object is implicit in the name of the routine; otherwise
+    the object is an explicit parameter to the call.
+
 Modify 9.7.2(4)
 
     For the execution of a timed_entry_call, the entry_name{, procedure_name,
@@ -297,15 +332,19 @@
 
 [end of AI-251-relative changes]
 
+Delete the last sentence of 12.6(9) since the view can be used as an entry:
+
+[The view is a function or procedure, never an entry.]
+
 !example
 
     package Example is
         type Actor is task interface;
-        procedure Give_Name(A : Actor; Name : String);
+        procedure Give_Name(A : Actor; Name : String) is abstract;
            -- Give name to an actor
 
-        procedure Start(A : Actor);
-        procedure Stop(A : Actor);
+        procedure Start(A : Actor) is abstract;
+        procedure Stop(A : Actor) is abstract;
           -- Other operations
 
         task type Stage_Actor is new Actor with
@@ -522,12 +561,17 @@
 Such interfaces cannot be implemented explicitly by
 "normal" tagged types.
 
-QUESTIONS:
+While we're relaxing restrictions, we've also eliminated the restriction
+that prevented a limited interface from being implemented by a non-limited
+type. This restriction existed primarily because of difficulties determining
+the difference between normal and return-by-reference types. Since AI-318-2
+has relegated return-by-reference types to the dustbin of history, there no
+longer is any need for the restriction. That means that a limited interface
+is nearly universal, in that it can be implemented by a tagged types (whether
+limited or non-limited), a task type, or a protected type.
 
-In general, how should language-defined interfaces be named, especially
-ones like these which more represent "predicates" than real interfaces?
-In Java, such interfaces are typically named using adjectives, such
-as "Cloneable". So perhaps "Is_Task" and "Is_Protected" and "Is_Task_Safe"?
+This proposal also makes a slight change to the syntax of interfaces, adding
+the keyword AND in order to make the definition interfaces more readable.
 
 IMPLEMENTATION NOTES:
 
@@ -641,8 +685,368 @@
 We considered supporting entry families, but ultimately
 dropped the capability as not providing sufficient benefit
 given the added complexity of the model.
+
+!corrigendum 2.9(3)
 
---!corrigendum 03.0x.0x(0x)
+@drepl
+NOTES@hr
+6 The reserved words appear in @b<lower case boldface> in this International
+Standard, except when used in the @fa<designator> of an attribute (see
+4.1.4). Lower case boldface is also used for a reserved word
+in a @fa<string_literal> used as an @fa<operator_symbol>. This is merely a
+convention @emdash programs may be written in whatever typeface is desired and
+available.
+@dby
+@b<synchronized> is a nonreserved keyword.
+
+NOTES@hr
+6 The reserved words appear in @b<lower case boldface> in this International
+Standard, except when used in the @fa<designator> of an attribute (see
+4.1.4). Lower case boldface is also used for a reserved word
+in a @fa<string_literal> used as an @fa<operator_symbol>. This is merely a
+convention @emdash programs may be written in whatever typeface is desired and
+available.
+
+!corrigendum 3.9.1(3)
+
+@drepl
+The parent type of a record extension shall not be a class-wide type. If the
+parent type is nonlimited, then each of the components of the
+@fa<record_extension_part> shall be nonlimited. The accessibility level (see
+3.10.2) of a record extension shall not be statically deeper than that of its
+parent type. In addition to the places where Legality Rules normally apply (see
+12.3), these rules apply also in the private part of an instance of a generic
+unit.
+@dby
+The parent type of a record extension shall not be a class-wide type nor
+shall it be a synchronized tagged type (see 3.9.4). If the
+parent type is nonlimited, then each of the components of the
+@fa<record_extension_part> shall be nonlimited. The accessibility level (see
+3.10.2) of a record extension shall not be statically deeper than that of its
+parent type. In addition to the places where Legality Rules normally apply (see
+12.3), these rules apply also in the private part of an instance of a generic
+unit.
+
+!corrigendum 3.9.3(1)
+
+@drepl
+An @i<abstract type> is a tagged type intended for use as a parent type for
+type extensions, but which is not allowed to have objects of its own. An
+@i<abstract subprogram> is a subprogram that has no body, but is intended to be
+overridden at some point when inherited. Because objects of an abstract type
+cannot be created, a dispatching call to an abstract subprogram always
+dispatches to some overriding body.
+@dby
+An @i<abstract type> is a type intended for use as an ancestor of other types,
+but which is not allowed to have objects of its own. An @i<abstract subprogram>
+is a subprogram that has no body, but is intended to be overridden at some
+point when inherited. Because objects of an abstract type cannot be created, a
+dispatching call to an abstract subprogram always dispatches to some overriding
+body.
+
+@i<@s8<Static Semantics>>
+
+Interface types (see 3.9.4) are abstract types. In addition, a
+tagged type that has the reserved word @b<abstract> in its declaration
+is an abstract type. The class-wide type (see 3.4.1) rooted at an
+abstract type is not itself an abstract type.
+
+!corrigendum 3.9.3(2)
+
+@drepl
+An abstract type is a specific type that has the reserved word abstract in
+its declaration. Only a tagged type is allowed to be declared abstract.
+@dby
+Only a tagged type shall have the reserved word @b<abstract> in its
+declaration.
+
+!comment The wording of AI-251 for 3.9.4 is omitted here; as a new section,
+!comment we can't reference it. The changes are placed into the conflict file.
+!comment We just put a dummy paragraph here:
+!corrigendum 3.9.4(1)
+
+@dinsc
+An interface type is an abstract tagged type which provides a restricted
+form of multiple inheritance. A tagged, task, or protected type may be
+derived from one or more interface types.
+
+!corrigendum 6.3.1(24)
+
+@dinsa
+Two @fa<discrete_subtype_definition>s are @i<fully conformant> if they are
+both @fa<subtype_indication>s or are both @fa<range>s, the @fa<subtype_mark>s
+(if any) denote the same subtype, and the corresponding @fa<simple_expression>s
+of the ranges (if any) fully conform.
+@dinst
+Two subprograms or entries are @i<type conformant> (respectively @i<mode
+conformant>, @i<subtype conformant>, or @i<fully conformant>) if their profiles
+are type conformant (respectively mode conformant, subtype conformant, or fully
+conformant).
+
+!corrigendum 9.1(2)
+
+@drepl
+@xcode<@fa<task_type_declaration ::=
+   >@ft<@b<task type>>@fa< defining_identifier [known_discriminant_part] [>@ft<@b<is>>@fa< task_definition];>>
+@dby
+@xcode<@fa<task_type_declaration ::=
+   >@ft<@b<task type>>@fa< defining_identifier [known_discriminant_part] [>@ft<@b<is>>@fa<
+      [>@ft<@b<new>>@fa< interface_list >@ft<@b<with>>@fa<]
+      task_definition];>>
+
+!corrigendum 9.1(8)
+
+@dinsa
+A task declaration requires a completion, which shall be a @fa<task_body>, and
+every @fa<task_body> shall be the completion of some task declaration.
+@dinss
+Each @fa<interface_subtype_mark> of an @fa<interface_list> appearing within a
+@fa<task_type_declaration> shall denote a limited interface type that
+is not a protected interface.
+
+If a @fa<task_type_declaration> includes an @fa<interface_list>, then for each
+primitive subprogram inherited by the task type, at most one of the
+following shall apply:
+
+@xbullet<the inherited subprogram shall be overridden with a primitive
+subprogram of the task type, in which case the overriding
+subprogram shall be subtype conformant with the inherited
+subprogram and not abstract; or>
+
+@xbullet<the first parameter of the inherited subprogram shall be of the
+task type or an access parameter designating the task type, and there
+shall be an @fa<entry_declaration> for a single entry with the same
+identifier and a profile that is type conformant with that of the
+inherited subprogram after omitting this first parameter, in which case
+the inherited subprogram is said to be @i<implemented> by the conforming
+entry, and its profile after omitting the first parameter shall be
+subtype conformant with that of the entry.>
+
+If neither applies, the inherited subprogram shall be a null procedure.
+
+!corrigendum 9.1(9.1/1)
+
+@dinsa
+For a task declaration without a @fa<task_definition>, a @fa<task_definition>
+without @fa<task_item>s is assumed.
+@dinst
+If a @fa<task_type_declaration> includes an @fa<interface_list>, the task type
+is derived from each interface named in the @fa<interface_list>.
+
+!corrigendum 9.4(2)
+
+@drepl
+@xcode<@fa<protected_type_declaration ::=
+   >@ft<@b<protected type>>@fa< defining_identifier [known_discriminant_part] [>@ft<@b<is>>@fa< protected_definition];>>
+@dby
+@xcode<@fa<protected_type_declaration ::=
+   >@ft<@b<protected type>>@fa< defining_identifier [known_discriminant_part] [>@ft<@b<is>>@fa<
+      [>@ft<@b<new>>@fa< interface_list >@ft<@b<with>>@fa<]
+      protected_definition];>>
+
+!corrigendum 9.4(10)
+
+@dinsa
+A protected declaration requires a completion, which shall be a
+@fa<protected_body>, and every @fa<protected_body> shall be the completion of
+some protected declaration.
+@dinss
+Each @fa<interface_subtype_mark> of an @fa<interface_list> appearing within a
+@fa<protected_type_declaration> shall denote a limited interface type that
+is not a task interface.
+
+If a @fa<protected_type_declaration> includes an @fa<interface_list>, then
+for each primitive subprogram inherited by the protected type, at most
+one of the following shall apply:
+
+@xbullet<the inherited subprogram shall be overridden with a primitive
+subprogram of the protected type; in this case the overriding subprogram shall
+be subtype conformant with the inherited subprogram and not abstract; or>
+
+@xbullet<the first parameter of the inherited subprogram shall be of the
+protected type or an access parameter designating the protected type, and there
+shall be a @fa<protected_operation_declaration> for a protected subprogram or
+single entry with the same identifier within the
+@fa<protected_type_declaration>, having a profile that is type conformant with
+that of the inherited subprogram after omitting this first parameter; in this
+case the inherited subprogram is said to be @i<implemented> by the conforming
+protected subprogram or entry, and its profile after omitting the first
+parameter shall be subtype conformant with that of the protected
+subprogram or entry.>
+
+If neither applies, the inherited subprogram shall be a null procedure.
+
+If an inherited subprogram is implemented by a protected procedure or
+entry, then its first parameter shall be an access-to-variable parameter,
+or of mode @b<out> or @b<in out>.
+
+!corrigendum 9.4(11)
+
+@drepl
+A @fa<protected_definition> defines a protected type and its first subtype. The
+list of @fa<protected_operation_declaration>s of a @fa<protected_definition>,
+together with the @fa<known_discriminant_part>, if any, is called the visible
+part of the protected unit. The optional list of
+@fa<protected_element_declaration>s after the reserved word @b<private> is
+called the private part of the protected unit.
+@dby
+A @fa<protected_definition> defines a protected type and its first subtype. The
+list of @fa<protected_operation_declaration>s of a @fa<protected_definition>,
+together with the @fa<known_discriminant_part>, if any, is called the visible
+part of the protected unit. The optional list of
+@fa<protected_element_declaration>s after the reserved word @b<private> is
+called the private part of the protected unit. If a
+@fa<protected_type_declaration> includes an @fa<interface_list>, the
+protected type is derived from each interface named in the @fa<interface_list>.
+
+!corrigendum 9.7.2(1)
+
+@drepl
+A @fa<timed_entry_call> issues an entry call that is cancelled if the call (or
+a requeue-with-abort of the call) is not selected before the expiration time
+is reached.
+@dby
+A @fa<timed_entry_call> issues an entry call that is cancelled if the call (or
+a requeue-with-abort of the call) is not selected before the expiration time
+is reached. A procedure call may appear rather than an entry call for cases
+where the procedure might be implemented by an entry.
+
+!corrigendum 9.7.2(3)
+
+@drepl
+@xcode<@fa<entry_call_alternative ::=
+   entry_call_statement [sequence_of_statements]>>
+@dby
+@xcode<@fa<entry_call_alternative ::=
+   procedure_or_entry_call_statement [sequence_of_statements]>>
+
+@xcode<@fa<procedure_or_entry_call ::=
+   procedure_call_statement | entry_call_statement>>
+
+@i<@s8<Legality Rules>>
+
+If a @fa<procedure_call_statement> is used for a @fa<procedure_or_entry_call>,
+the @i<procedure_>@fa<name> or @i<procedure_>@fa<prefix> of the
+@fa<procedure_call_statement> shall denote an entry renamed as a procedure, a
+formal subprogram, or (a view of) a primitive subprogram of a limited interface
+whose first parameter is a controlling parameter (see 3.9.2).
+
+@i<@s8<Static Semantics>>
+
+If a @fa<procedure_call_statement> is used for a @fa<procedure_or_entry_call>,
+and the procedure is implemented by an entry, then the @i<procedure_>@fa<name>,
+or @i<procedure_>@fa<prefix> and possibly the first parameter of
+the @fa<procedure_call_statement>, determine the target object of the call
+and the entry to be called.
+
+!corrigendum 9.7.2(4)
+
+@drepl
+For the execution of a @fa<timed_entry_call>, the @i<entry_>@fa<name> and the
+actual parameters are evaluated, as for a simple entry call (see 9.5.3). The
+expiration time (see 9.6) for the call is determined by evaluating the
+@i<delay_>@fa<expression> of the @fa<delay_alternative>; the entry call is then
+issued.
+@dby
+For the execution of a @fa<timed_entry_call>, the @i<entry_>@fa<name>,
+@i<procedure_>@fa<name>, or @i<procedure_>@fa<prefix>, and any actual
+parameters are evaluated, as for a simple entry call (see 9.5.3) or procedure
+call (see 6.4). The expiration time (see 9.6) for the call is determined by
+evaluating the @i<delay_>@fa<expression> of the @fa<delay_alternative>. If the
+call is an entry call or a call on a procedure implemented by an entry, the
+entry call is then issued. Otherwise, the call proceeds as described in 6.4 for
+a procedure call, followed by the sequence_of_statements of the
+entry_call_alternative, and the delay_alternative sequence_of_statements is
+ignored.
+
+!corrigendum 9.7.4(4)
+
+@drepl
+@xcode<@fa<triggering_statement ::= entry_call_statement | delay_statement>>
+@dby
+@xcode<@fa<triggering_statement ::= procedure_or_entry_call_statement | delay_statement>>
+
+!corrigendum 9.7.4(6)
+
+@drepl
+For the execution of an @fa<asynchronous_select> whose @fa<triggering_statement>
+is an @fa<entry_call_statement>, the @i<entry_>@fa<name> and actual parameters
+are evaluated as for a simple entry call (see 9.5.3), and the entry call is
+issued. If the entry call is queued (or requeued-with-abort), then the
+@fa<abortable_part> is executed. If the entry call is selected immediately,
+and never requeued-with-abort, then the @fa<abortable_part> is never started.
+@dby
+For the execution of an @fa<asynchronous_select> whose
+@fa<triggering_statement> is an @fa<procedure_or_entry_call_statement>, the
+@i<entry_>@fa<name>, @i<procedure_>@fa<name>, or @i<procedure_>@fa<prefix>, and
+any actual parameters are evaluated as for a simple entry
+call (see 9.5.3) or procedure call (see 6.4). If the call is an entry call or a
+call on a procedure implemented by an entry, the entry call is issued. If the
+entry call is queued (or requeued-with-abort), then the @fa<abortable_part> is
+executed. If the entry call is selected immediately, and never
+requeued-with-abort, then the @fa<abortable_part> is never started. If the call
+is on a procedure that is not implemented by an entry, the call proceeds as
+described in 6.4, followed by the @fa<sequence_of_statements> of the
+@fa<triggering_alternative>, and the @fa<abortable_part> is never started.
+
+!corrigendum 9.8(3)
+
+@drepl
+Each @i<task_>@fa<name> is expected to be of any task type; they need not all
+be of the same task type.
+@dby
+Each @i<task_>@fa<name> is expected to be of any task type or task interface
+type; they need not all be of the same type.
+
+!corrigendum 9.9(1)
+
+@drepl
+For a @fa<prefix> T that is of a task type (after any implicit dereference),
+the following attributes are defined:
+@dby
+For a @fa<prefix> T that is of a task type or task interface type (after any
+implicit dereference), the following attributes are defined:
+
+!comment The wording of AI-251 for 12.5.5 is omitted here; as a new section,
+!comment we can't reference it. The changes are placed into the conflict file.
+!comment We just put a dummy paragraph here:
+!corrigendum 12.5.5(1)
+
+@dinsc
+The class determined for a formal interface type is the class of all
+interface types.
+
+!corrigendum 12.6(9)
+
+@drepl
+A @fa<formal_subprogram_declaration> declares a generic formal subprogram. The
+types of the formal parameters and result, if any, of the formal subprogram are
+those determined by the @fa<subtype_mark>s given in the
+@fa<formal_subprogram_declaration>; however, independent of the particular
+subtypes that are denoted by the @fa<subtype_mark>s, the nominal subtypes of
+the formal parameters and result, if any, are defined to be nonstatic, and
+unconstrained if of an array type (no applicable index constraint is provided
+in a call on a formal subprogram). In an instance, a
+@fa<formal_subprogram_declaration> declares a view of the actual. The profile
+of this view takes its subtypes and calling convention from the original
+profile of the actual entity, while taking the formal parameter @fa<name>s and
+@fa<default_expression>s from the profile given in the
+@fa<formal_subprogram_declaration>. The view is a function or procedure, never
+an entry.
+@dby
+A @fa<formal_subprogram_declaration> declares a generic formal subprogram. The
+types of the formal parameters and result, if any, of the formal subprogram are
+those determined by the @fa<subtype_mark>s given in the
+@fa<formal_subprogram_declaration>; however, independent of the particular
+subtypes that are denoted by the @fa<subtype_mark>s, the nominal subtypes of
+the formal parameters and result, if any, are defined to be nonstatic, and
+unconstrained if of an array type (no applicable index constraint is provided
+in a call on a formal subprogram). In an instance, a
+@fa<formal_subprogram_declaration> declares a view of the actual. The profile
+of this view takes its subtypes and calling convention from the original
+profile of the actual entity, while taking the formal parameter @fa<name>s and
+@fa<default_expression>s from the profile given in the
+@fa<formal_subprogram_declaration>.
 
 !ACATS test
 

Questions? Ask the ACAA Technical Agent