From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!feeder5.feed.usenet.farm!feed.usenet.farm!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!nzpost2.xs4all.net!news.kpn.nl!not-for-mail Subject: Re: Using Generic Pasckages To: Stephen Leake Newsgroups: comp.lang.ada References: <5e8edf69$0$18432$e4fe514c@news.kpn.nl> From: ldries46 Message-ID: Date: Sat, 11 Apr 2020 15:16:48 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: nl NNTP-Posting-Host: e5d478f6.news.kpn.nl X-Trace: G=Ru12udLb,C=U2FsdGVkX1+PNDxmD2luglrqHCe5BFcUo7kM5azX0S07IZ6lqLfDWO/o+6mahh5Ws2r+AwSjnQPJ4lDDNawsVkn9sgspkesv6RajthZNR2E= X-Complaints-To: abuse@kpn.nl Xref: reader01.eternal-september.org comp.lang.ada:58342 Date: 2020-04-11T15:16:48+02:00 List-Id: 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.