comp.lang.ada
 help / color / mirror / Atom feed
From: "Matthew Heaney" <mheaney@on2.com>
Subject: Re: Q: Hiding the structure of a tagged type using containers
Date: 9 May 2006 07:52:00 -0700
Date: 2006-05-09T07:52:00-07:00	[thread overview]
Message-ID: <1147186320.100422.245170@v46g2000cwv.googlegroups.com> (raw)
In-Reply-To: <uzmhrr942.fsf@acm.org>


Stephen Leake wrote:
> brian.b.mcguinness@lmco.com writes:
>
>
> The general solution to this error is to make one of the arguments
> class-wide; in this case:
>
> procedure Shape
>    (A : in APL_Array_Dimensioned; Dimensions : out APL_Shape'class);

This won't work, since the APL_Shape isn't tagged at the point where
Shape is declared.


> Another solution is to use only one tagged type. Apparently
> APL_Dimension_List.Vector is visibly tagged; perhaps it does not need
> to be?

We debated this during the design of the container library, and
concluded that we might as well make the type tagged, since the most
likely implementation would be that container types privately derive
from Controlled.  Making the container types publicly tagged then gives
you other benefits such as as implicit aliasing of subprogram
parameters and distinguished-receiver syntax.

The solution in this case is to implement the full view of type
APL_Shape as a non-tagged record, with a vector component.

-Matt




  reply	other threads:[~2006-05-09 14:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-09  1:52 Q: Hiding the structure of a tagged type using containers brian.b.mcguinness
2006-05-09  6:43 ` Stephen Leake
2006-05-09 14:52   ` Matthew Heaney [this message]
2006-05-10 11:50     ` Craig Carey
2006-05-09 14:47 ` Matthew Heaney
2006-05-09 14:55   ` brian.b.mcguinness
replies disabled

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