comp.lang.ada
 help / color / mirror / Atom feed
From: ldries46 <bertus.dries@planet.nl>
To: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Using Generic Pasckages
Date: Sat, 11 Apr 2020 15:16:48 +0200
Date: 2020-04-11T15:16:48+02:00	[thread overview]
Message-ID: <b7de6f61-c6d1-1f33-f99c-90994971c4ff@planet.nl> (raw)
In-Reply-To: <de08b03f-0b20-416f-9282-5bd2da7da1bf@googlegroups.com>

Op 10-4-2020 om 18:34 schreef Stephen Leake:
> On Thursday, April 9, 2020 at 1:40:11 AM UTC-7, ldries46 wrote:
>> I have created some generic packages. tese are packages that only do the
>> same thing but with other types. Till now I did only need these packages
>> without interaction with between packages using the same type. I just
>> can declare them:
>> Package AA is new BB(type); then calling them as
>> A := AA.Get_Value;
>> No other declaration seemed to be neccesary .
>>
>> 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;
> Why do you have both AA and CC? Clearly they instantiate to the same code. Eliminate one of them.
>
> Unless you've simplified things for this post, in which case you've simplified too much.
>
> -- Stephe
The problem is that I have two streams of data within my program that 
are almost the same I just have to safe them in two random access 
buffers. These two buffers will be filled with two complete different 
sets of data.
The difference between these data streams is not the program part where 
most of the buffering  is done. That part is identical between the two 
data streams. So I wanted to use the same procedures and functions where 
possible.
I already have a generic package for such a buffer (instantiations can 
be made for all kind of types(f.i integers, unbounded_Strings). Do it is 
logical that I want to use that package with two instantiations for the 
same type.

  reply	other threads:[~2020-04-11 13:16 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
2020-04-09 20:45 ` Jere
2020-04-10 16:34 ` Stephen Leake
2020-04-11 13:16   ` ldries46 [this message]
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