comp.lang.ada
 help / color / mirror / Atom feed
From: Jim Rogers <jimmaureenrogers@worldnet.att.net>
Subject: Re: Sugestion to Multiple Inheritance
Date: Thu, 17 Jan 2002 20:52:33 GMT
Date: 2002-01-17T20:52:33+00:00	[thread overview]
Message-ID: <3C473983.2000902@worldnet.att.net> (raw)
In-Reply-To: slrna4dpdm.kn.lutz@taranis.iks-jena.de

Lutz Donnerhacke wrote:

> 
> Let's try to code this:
> 
> package Sorts is
>    function Sort (col : Collection) return Collection is abstract;
>    procedure Sort (col : in out Collection) is abstract;
> end package Sorts;
> 
> with Sorts;
> package Stable_Sorts is
>    function Sort renames Sorts.Sort;
> end package Stable_Sorts;
> 
> with Sorts;
> package Inplace_Sorts is
>    procedure Sort renames Sorts.Sort;
> end package Stable_Sorts;
> 
> with Stable_Sorts, Inplace_Sorts;
> package Stable_Inplace_Sorts is
>    procedure Sort renames ?;
> end package;


Since the only sort procedure available to rename is
Inplace_Sorts.Sort, that must be the procedure you want to
rename. If, on the other hand, the Stable_Inplace_Sorts.Sort
must work with both the Stable_Sorts.Sort function and the
Inplace_Sorts.Sort procedure, you must not rename anything.
You must define the way those two Sort subprograms interact.
This means defining an entirely new Sort procedure for the
package Stable_Inplace_Sorts. This is one of the problems NOT
solved by multiple inheritance.

In fact, in this example, Stable_Inplace_Sorts would have
access to all the subprograms defined in Sorts. It would be
clearer to simply "with" or inherit from the Sorts
package directly.

Jim Rogers
Colorado Springs, Colorado USA






  reply	other threads:[~2002-01-17 20:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-11 10:20 Sugestion to Multiple Inheritance Lutz Donnerhacke
2002-01-11 17:21 ` Stephen Leake
2002-01-11 17:53   ` Lutz Donnerhacke
2002-01-11 19:57     ` Stephen Leake
2002-01-17  8:28       ` Lutz Donnerhacke
2002-01-17 14:31         ` Stephen Leake
2002-01-17 14:54           ` Lutz Donnerhacke
2002-01-17 20:52             ` Jim Rogers [this message]
2002-01-11 18:07 ` Mark Lundquist
2002-01-11 18:14 ` Richard Riehle
2002-01-11 20:56   ` Hyman Rosen
2002-01-12  7:35     ` Richard Riehle
2002-01-13  6:37       ` Hyman Rosen
2002-01-14 13:58         ` John English
2002-01-14 16:27           ` Ole-Hjalmar Kristensen
2002-01-12  2:09   ` Will
2002-01-11 22:04 ` Matthew Heaney
2002-01-15 15:32   ` Hyman Rosen
2002-01-15 16:03     ` Lutz Donnerhacke
2002-01-18 19:03       ` Matthew Heaney
2002-01-21 11:23         ` Lutz Donnerhacke
2002-01-21 16:43           ` Brian Rogoff
2002-01-21 17:00             ` Lutz Donnerhacke
2002-01-22 16:55               ` Brian Rogoff
2002-01-23  8:58                 ` Dmitry A. Kazakov
2002-01-25  0:09                   ` Brian Rogoff
2002-01-28 16:23                     ` Dmitry A. Kazakov
2002-01-12  0:28 ` Nick Roberts
replies disabled

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