comp.lang.ada
 help / color / mirror / Atom feed
From: stt@houdini.camb.inmet.com (Tucker Taft)
Subject: Re: class-wide objects
Date: 1998/12/07
Date: 1998-12-07T00:00:00+00:00	[thread overview]
Message-ID: <F3LpHA.Hro.0.-s@inmet.camb.inmet.com> (raw)
In-Reply-To: 366B1190.C8142307@magic.fr

Francois Godme (fgodme@magic.fr) wrote:

: ...
: An attribute to get the subtype of the actual tagged parameter would
: solve both problems. May be we could combine
: the two attributes 'Class and 'Tag together:

: procedure P4 (S : in Point'Class;
:               N : in Natural) is

:    Local : Point'Class (S'Tag); -- allocates an object with the tag of S

:    subtype T_Local_Point is Point'Class (S'Tag);

:    Local_Array : array (1 .. N) of T_Local_Point;

: begin
:    ...
: end P4;

: What do you think ? Am I right or am I missing something ? Could the
: GNAT team provide an implementation defined attribute for this ?

Just providing the tag is not enough, because the type might
have discriminants as well, which must be specified at the
point of declaration.  One could imagine some new attribute
like "'Subtype" and then write:

    Local : Point'Class(S'Subtype);

In fact, something like this was proposed during the Ada 9X
revision process, but it didn't make the "cut" among the
various language revision proposals.

: Francois Godme
--
-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
Intermetrics, Inc.  Burlington, MA  USA
An AverStar Company




  parent reply	other threads:[~1998-12-07  0:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-12-07  0:00 class-wide objects Francois Godme
1998-12-07  0:00 ` Tom Moran
1998-12-07  0:00 ` Tucker Taft [this message]
1998-12-07  0:00   ` Francois Godme
1998-12-07  0:00 ` Matthew Heaney
1998-12-06  0:00   ` David Botton
1998-12-09  0:00   ` Francois Godme
1998-12-10  0:00     ` Matthew Heaney
1998-12-10  0:00       ` Francois Godme
1998-12-11  0:00       ` Stephen Leake
1998-12-12  0:00         ` Francois Godme
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox