comp.lang.ada
 help / color / mirror / Atom feed
From: Dennis Hoppe <dennis.hoppe@hoppinet.de>
Subject: Re: Ada: Inheritance of generics
Date: Mon, 02 Jun 2008 23:10:03 +0200
Date: 2008-06-02T23:10:03+02:00	[thread overview]
Message-ID: <g21njb$scn$1@aioe.org> (raw)
In-Reply-To: 

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



  reply	other threads:[~2008-06-02 21:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-02 13:39 Ada: Inheritance of generics Dennis Hoppe
2008-06-02 13:51 ` Dmitry A. Kazakov
2008-06-02 14:17   ` Dennis Hoppe
2008-06-02 14:34     ` Georg Bauhaus
2008-06-02 15:09     ` Dmitry A. Kazakov
2008-06-02 15:13     ` Adam Beneschan
2008-06-02 21:10       ` Dennis Hoppe [this message]
2008-06-02 14:30 ` Georg Bauhaus
replies disabled

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