Version 1.1 of acs/ac-00056.txt

Unformatted version of acs/ac-00056.txt version 1.1
Other versions for file acs/ac-00056.txt

!standard 3.5(15)          03-06-23 AC95-00056/01
!standard 3.9(14)
!class amendment 03-06-23
!status received no action 03-06-23
!subject Base and class attributes
!summary
!appendix

From: Nick Roberts
Sent: Tuesday, March 4, 2003  9:13 AM

Further to my previous post, I would like to propose that the Base and Class
attributes both be made applicable to all subtypes.

In essence, I believe the possible problems are resolved by specifying that
S'Class is /always/ indefinite, and by expanding the applicability of the
Definite attribute so that S'Base can always be tested as to whether it is
actually definite or not.

The new definitions for Base and Class could be very simple in themselves.

:: For every subtype S, S'Base denotes the base subtype of the type of S;

:: For every subtype S, S'Class denotes the class-wide subtype of S.

We then go on to provide a comprehensive definition of the 'base subtype' of
every kind of type and 'class-wide subtype' of every kind of subtype. My
suggestions are as follows.

(A1) Every type has exactly one base subtype.

(A2) Every subtype has exactly one class-wide subtype.

(B1) The base subtype of a scalar type, composite (including specific
tagged) type, task type, or protected type T is an unconstrained subtype of
T [and so may or may not be indefinite].

(B2) The base subtype of a private type T (generic formal or not, limited or
not, tagged or not) is a subtype of T [which may or may not be indefinite,
but this can be tested using the Definite attribute].

(B3) The base subtype of a class-wide type T is a subtype of T [which must
therefore be indefinite and] which is unconstrained if T is constrainable.

(B4) The base subtype of an access-to-object type T is an unconstrained
subtype of T [and is definite].

(B5) The base subtype of an access-to-subprogram type T is a subtype of T
[and is definite].

(C1) The class-wide subtype of a specific tagged subtype S is a subtype of
the class-wide type rooted at the type of S [and is therefore indefinite],
which, if S has a constraint, has the same constraint.

(C2) The class-wide subtype of a class-wide (tagged) subtype S is a subtype
of the type of S [and is therefore indefinite], which, if S has a
constraint, has the same constraint.

(C3) The class-wide subtype of an untagged (non class-wide) private subtype
S is a subtype of the type of S, and is indefinite.

(C4) The class-wide subtype of an access-to-object subtype whose designated
subtype is S is a subtype of an access type whose designated subtype is
S'Class, and is indefinite.

(C5) The class-wide subtype of a access-to-subprogram subtype S is a subtype
of the type of S, and is indefinite.

(C6) The class-wide subtype of a signed integer subtype is an unconstrained
subtype of the biggest signed integer type supported by the implementation,
and is indefinite.

(C7) The class-wide subtype of a modular integer type is an unconstrained
subtype of the biggest modular integer type supported by the implementation,
and is indefinite.

(C8) The class-wide subtype of an enumeration subtype S is an unconstrained
subtype of the type of S, and is indefinite.

(C9) The class-wide subtype of a floating-point type T is an unconstrained
subtype of the biggest floating-point type supported by the implementation,
and is indefinite.

(C10) The class-wide subtype of an ordinary fixed-point subtype S is an
unconstrained subtype of the type of S, and is indefinite.

(C11) The class-wide subtype of a decimal fixed-point subtype S is an
unconstrained subtype of the type of S, and is indefinite.

(C12) The class-wide subtype of a separate type is the class-wide subtype of
the type declared by the corresponding separate type completion.

These rules probably aren't quite right, or comprehensive, but I think they
demonstrate the idea. I suspect there's a much better way of formulating
them. Obviously rule C12 assumes the introduction of a separate type.

The new definition of the Definite attribute could simply allow it to be
applied to any subtype.

The basic motivation is to allow T'Class for a generic formal private type
T, which is formally untagged, but which could be matched by a tagged actual
in an instantiation. It's also to allow T'Class for an incomplete or
separate type without compelling the completion to be tagged.

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


Questions? Ask the ACAA Technical Agent