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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4b3c1a8f7db90f9 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!feeder.news-service.com!transit4.hitnews.eu!xlned.com!feeder1.xlned.com!npeer.de.kpn-eurorings.net!npeer-ng1.kpn.DE!newsfeed.arcor.de!newsspool2.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Interfaces and abstract tagged types Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1w8x4i0peinwk$.16cenhvch5kv5.dlg@40tude.net> <6a44b25e-07c7-4b3f-9e22-08a778073e4a@q26g2000prq.googlegroups.com> <48f716fc$0$28911$9b4e6d93@newsspool1.arcor-online.net> <4ba8b27d-6228-4451-bfc6-ef19dd4b96cb@k13g2000hse.googlegroups.com> Date: Sat, 25 Oct 2008 10:57:29 +0200 Message-ID: <6bum6osar2sr.18v0h7zintcn0.dlg@40tude.net> NNTP-Posting-Date: 25 Oct 2008 10:57:28 CEST NNTP-Posting-Host: 3f31b0e9.newsspool1.arcor-online.net X-Trace: DXC=DQ]PcR:?a@:]E=H1Q9`787ic==]BZ:af>4Fo<]lROoR14nDHegD_]R5AANOI8:UeG5DNcfSJ;bb[5IRnRBaCdG:UkVNEl;V;?6mIZCTX1_= X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:8219 Date: 2008-10-25T10:57:28+02:00 List-Id: On Wed, 22 Oct 2008 23:39:10 -0700 (PDT), Ivan Levashew wrote: >> The perversion is that inheritance as form of polymorphism is >> technically >> replaced by another form of (parametric polymorphism). What are >> interfaces for, if generics must be used instead? > > Interfaces are for run-time polymorphism, the final goal. > Generics is just an aid to do it in a handy way. Oh, certainly pulling a car with horses is an aid, but I prefer its engine... >> In order to handle this exponentially exploding code, >> generics are >> introduced down the tree. I.e. Bi becomes a generic and >> interfaces are >> passed as formal parameters of. Then the generic instances >> are passed down >> the tree to lower generics. > > Right, it is supposed to be used this way. Maybe your complaints are > due to lack of good UML tools for Ada 2005? One meta language (generics) is far than enough to make it unmaintainable. You suggest that yet another layer put on top the pile should help? Anyway, I don't like the idea that Ada interfaces where introduced just in order to support sells of UML tools... (:-)) >> The interface >> cannot be inherited from a concrete type > > I think this is obvious that Ada designer can't let you do this > trick. A concrete type might have more primitive operation than > interface you're want to declare. This is a software design issue, not compiler's business. Do not inherit if you prefer cut-and-paste. > List and Vector have extra > operations that can be done efficiently. How can Ada compiler be sure > whether you'd like to treat Vector implementation as an implementation > of hypothethic Vector_Interface or whether Vector is just an > enumerable container. If it's really the case that every primitive > operation must be copied to the interface, this fact must be stated > explicitly. I don't understand the problem. Clearly, when you inherit, you do everything visible. Same happens when you inherit interface from interface, why does not it bother you then? There exist separate issues of disallowing operations and/or delegation. Neither is possible in Ada, but these are unrelated to interfaces. ---------- Basically, there should be no language concept "interface." It is fundamentally wrong, because it reveals something about the implementation (that no one shall exist). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de