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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,34c2aa33b8bdb1a9 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-01-17 12:52:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3C473983.2000902@worldnet.att.net> From: Jim Rogers User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Sugestion to Multiple Inheritance References: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 17 Jan 2002 20:52:33 GMT NNTP-Posting-Host: 12.86.34.23 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1011300753 12.86.34.23 (Thu, 17 Jan 2002 20:52:33 GMT) NNTP-Posting-Date: Thu, 17 Jan 2002 20:52:33 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:19026 Date: 2002-01-17T20:52:33+00:00 List-Id: 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