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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,a3c2ec05bff4ab48 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news.glorb.com!feeder.erje.net!aioe.org!not-for-mail From: Dennis Hoppe Newsgroups: comp.lang.ada Subject: Re: Ada: Inheritance of generics Date: Mon, 02 Jun 2008 23:10:03 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <1d2swajw7rsue$.ftt2098a7wvt$.dlg@40tude.net> <1755c5d8-8c27-4219-8670-80086f098ba5@a32g2000prf.googlegroups.com> NNTP-Posting-Host: ASGDYjLDfmc9FZUN45ADsA.user.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org In-Reply-To: User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) Xref: g2news1.google.com comp.lang.ada:537 Date: 2008-06-02T23:10:03+02:00 List-Id: Hello Adam, Adam Beneschan wrote: > There's so many things wrong with this code that I'm just going to > take a guess at what you're trying to do and hope it's close to what > you're looking for. If not, you'll need to explain more about what > you're trying to accomplish. The following Ada source does compile. Thank you for your effort. It does exactly, what I wanted to do. It seems, that I should read a bit more about inheritance und generics in Ada to understand this two different approaches of programming. My own implementation failed due the wrong instantiation of the packages. Your last code snippets helped me the most. > package Mod_Package is > type Unsigned_16 is mod 2**16; > end Mod_Package; > > with Generic_Parent; > with Mod_Package; > package Parent is new Generic_Parent (Mod_Package.Unsigned_16); > > with Parent; > with Generic_Parent.Generic_Child; > package Child is new Parent.Generic_Child; > > with Child; > package Pak1 is > A : Integer := Child.Example; > end Pak1; > > -- HTH, Adam Thank you, Dennis