Version 1.1.1.1 of ais/ai-00102.txt

Unformatted version of ais/ai-00102.txt version 1.1.1.1
Other versions for file ais/ai-00102.txt

!standard 03.07 (10)          97-11-14 AI95-00102/01
!class confirmation 97-05-08
!status WG9 Approved 97-11-14
!status ARG approved (6-0-1) subject to editorial review 97-04-11
!status work item 95-10-12
!status received 95-10-12
!priority Medium
!difficulty Medium
!subject A generic formal limited private type can have an access discriminant.
!summary 95-10-12
A generic formal limited private type can have an access discriminant.
!question 97-05-08
Is the following generic package declaration legal? (Yes.)
generic type T1 is private; type T2 (D: access T1) is limited private; -- Legal? (Yes.) package P is end P;
RM-3.7(10) states, "A discriminant specification for an access discriminant shall appear only in the declaration for a task or protected type, or for a type with the reserved word limited in its (full) definition or in that of one of its ancestors."
A generic formal limited private type does not have a full definition, so it cannot meet this criterion (unless "in its (full) definition" means "in its full definition, if any, and otherwise in its definition").
!response 95-10-12
The intent was to allow such types to have access discriminants.
The fact that the word "full" is parenthesized (and in the AARM, is bracketed), leads one to the conclusion that it was intended as a parenthetical remark. It is not intended to mean that the type must have a full definition.
!appendix

!section 3.7(10)
!subject Can a generic formal limited private type have an access discriminant?
!reference RM95-3.7(10);6.0
!from Norman Cohen 95-09-07
!reference as: 95-5325.b Robert A Duff 95-10-11>>
!discussion

Is the following generic package declaration legal?

   generic
      type T1 is private;
      type T2 (D: access T1) is limited private;
   package P is
   end P;

RM-3.7(10) states, "A discriminant specification for an access
discriminant shall appear only in the declaration for a task or protected
type, or for a type with the reserved word @b{limited} in its (full)
definition or in that of one of its ancestors."

A generic formal limited private type does not have a full definition, so
it cannot meet this criterion (unless "in its (full) definition" means
"in its full definition, if any, and otherwise in its definition").

----------------------------- Note follows ------------------------------
Date: Thu, 7 Sep 1995 10:35:50 -0400
From: stt@dsd.camb.inmet.com (Tucker Taft)
Message-Id: <9509071435.AA15533@houdini.i2ada>
To: aqs_drs@software.org, ausnit@software.org, ncohen@watson.ibm.com
Subject: Re: generic formal tagged types

> ...
> The only types that can have access discriminants are certain limited
> types.  (See RM 3.7(10).)  However, it's not clear to me whether
>
>    generic
>       type T1 is private;
>       type T2 (D: access T1) is limited private;
>
> is meant to be legal.  RM 3.7(10) could be construed as stating that only
> types with full definitions can have access discriminants, which in turn
> could be construed as eliminating generic formal limited private types.
> (STT, are you there?)

This was certainly intended to be legal.  I agree that 3.7(10) is
confusing here, but there is a general philosophy that formal
private types should be treated as much as possible like "normal"
private types where the full type is specified by the actual type
upon instantiation.  See AARM 7.3(19.a-19.f).

> -- Norman

-Tuck

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

Questions? Ask the ACAA Technical Agent