comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: inheritence and generic
Date: Tue, 09 Dec 2003 10:00:19 +0100
Date: 2003-12-09T10:00:19+01:00	[thread overview]
Message-ID: <8c3btvojvf1lth380frkl1fse0eo96574c@4ax.com> (raw)
In-Reply-To: 3fd52491@news.barak.net.il

On Tue, 9 Dec 2003 03:23:25 +0200, "Ratson Janiv" <janiv@013.net.il>
wrote:

>I have the following code :
>
>generic
>
>type Bounded_Q is new Queue with private;
>
>
>package Jr.Queue.Max_Queue.Bounded is
>
>
>type Max_Bounded_Queue is new Max_Queue with private;
>
>
>procedure Push(Q: in out Max_Bounded_Queue ; Item:T);
>
>private
>
>type Max_Bounded_Queue is new Max_Queue with record
>
>BQ : Bounded_Q;
>
>end record;
>
>end Jr.Queue.Max_Queue.Bounded;
>
>---------------------------------------------------------------------------
>
>package body Jr.Queue.Max_Queue.Bounded is
>
>
>procedure Push(Q: in out Max_Bounded_Queue;Item:T) is
>
>begin
>
>Q.BQ.Push(Q,Item);

Shouldn't it be:

Q.BQ.Push (Q.BQ, Item);

But the design looks strange. You derive Max_Bounded_Queue from
Max_Queue and also aggregate Queue in it. In effect it will be twice a
queue. Should it be so?

--
Regards,
Dmitry Kazakov
http://www.dmitry-kazakov.de



      reply	other threads:[~2003-12-09  9:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-09  1:23 inheritence and generic Ratson Janiv
2003-12-09  9:00 ` Dmitry A. Kazakov [this message]
replies disabled

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