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,91276ec2ea911d3f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!grolier!usenet-fr.net!proxad.net!proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail Date: Thu, 07 Sep 2006 08:48:21 +0200 From: Georg Bauhaus User-Agent: Thunderbird 1.5.0.5 (Windows/20060719) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Generic procedures and their parameters References: <15ibl2xejtc68.1eg90p1fwn18p$.dlg@40tude.net> <1157560557.6258.24.camel@localhost> In-Reply-To: X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Message-ID: <44ffdc83$0$18489$9b4e6d93@newsspool3.arcor-online.net> Organization: Arcor NNTP-Posting-Date: 07 Sep 2006 10:46:59 CEST NNTP-Posting-Host: 2b7817d8.newsspool3.arcor-online.net X-Trace: DXC=D_=HPBCP[`kUoRk[hk2WalMcF=Q^Z^V3h4Fo<]lROoRa4nDHegD_]Rel6o8ec X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:6493 Date: 2006-09-07T10:46:59+02:00 List-Id: Dmitry A. Kazakov wrote: > But this all is independent on the question whether interface and > implementation inheritances are different things. They are not. Suppose I have some complex number type C having a lengthy division operation that requires auxiliary components in the implementation. Now I want a type of complex numbers just like C but without a division operation. One way to do so might seem to inherit a D from C, and clear the division operation, type C is tagged private; ... procedure division(a, b: C; result: in out C); type D is new C with private; ... overriding procedure division(a, b: D; result: in out D) is null; (Is there anything better than null BTW? It won't remove division from D's interface...) This will leave the auxiliary components of C in D. But couldn't I do better? For example, by declaring the interface I want, and then requesting that the needed operations be "extracted" from C, dropping the division stuff (provided there is a way to mark components as being needed by only some set of operations.) I will loose view conversions to C. But if that is what I want? Just a composition of the interface I need in some scope?