comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Using Generic Pasckages
Date: Thu, 09 Apr 2020 19:23:43 +0100
Date: 2020-04-09T19:23:43+01:00	[thread overview]
Message-ID: <lyv9m834cw.fsf@pushface.org> (raw)
In-Reply-To: 5e8edf69$0$18432$e4fe514c@news.kpn.nl

ldries46 <bertus.dries@planet.nl> writes:

> Now I have the following situation:
> Package AA is new BB(integer);
> Package CC is new BB(integer);
> and a case where I have several statements using Package AA in one
> condition and CC the other case.
> I want  to do that by using:
> if D then EE := AA; else EE := CC; end if;
> But I cannot find in the documentation  how the declaration of EE
> should be made.

Presume you mean

   if D then EE := AA.Get_Value; else EE := CC.Get_Value; end if;

which will work fine as long as Get_Value returns the type that AA, CC
were instantiated with & not some derived tye.

  parent reply	other threads:[~2020-04-09 18:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09  8:40 Using Generic Pasckages ldries46
2020-04-09  8:57 ` Dmitry A. Kazakov
2020-04-09 10:05   ` ldries46
2020-04-09 11:23     ` Dmitry A. Kazakov
2020-04-09 15:38 ` AdaMagica
2020-04-09 18:23 ` Simon Wright [this message]
2020-04-09 20:45 ` Jere
2020-04-10 16:34 ` Stephen Leake
2020-04-11 13:16   ` ldries46
2020-04-11 14:15     ` Jeffrey R. Carter
replies disabled

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