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-Language: ENGLISH,ASCII Path: g2news2.google.com!news4.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada vs Eiffel - Ada programmer approach Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <405b5054-4c8f-4e16-9ea8-503a9b9f976e@t21g2000yqi.googlegroups.com> <4A19765C.608@obry.net> <8105b65f-4de9-4653-b43a-d55ee33f072d@k2g2000yql.googlegroups.com> <9rWSl.118630$DP1.42605@attbi_s22> <02f8bbe8-b7fa-4633-bf90-1f2b9677264c@r34g2000vba.googlegroups.com> <9051a298-df04-448d-8a68-c2788185745e@p4g2000vba.googlegroups.com> Date: Thu, 4 Jun 2009 16:14:33 +0200 Message-ID: <1ncp11z9m7a4d$.tx2yt3geug2t.dlg@40tude.net> NNTP-Posting-Date: 04 Jun 2009 16:14:33 CEST NNTP-Posting-Host: c3797240.newsspool1.arcor-online.net X-Trace: DXC=Bi?^on_g2\Lk:C4l9A;OcOic==]BZ:afN4Fo<]lROoRA^YC2XCjHcbI`o@TPBXcPJDDNcfSJ;bb[EFCTGGVUmh?DLK[5LiR>kgB7Pl0_ck On Thu, 4 Jun 2009 05:14:56 -0700 (PDT), Hibou57 (Yannick Duch�ne) wrote: > On 4 juin, 11:19, "Dmitry A. Kazakov" > wrote: >> There is nothing that could replace inheritance, because there is no way to >> "invent" a new type out of nothing. Whatever type algebra operation you >> take, it always uses some building blocks (the arguments) from which you >> inherit the interface of the result. There is nothing really useful beyond >> inheritance. Even if you use the minimal possible type-algebraic operation >> in Ada: >> >> � �type T (<>) is limited private; >> >> you still inherit a lot of things. For example attributes, like X'Address. > > That's true. But in some languages, like Eiffel, inheritance comes > with classes, and classes are too much things at the same time. Many > things could be said about it, but the first one in this context, > would be : inheritance is one thing, dynamic dispatching is another. Right. It is a language design fault to bind these things together. Ada probably made many mistakes, but not this one. In Ada inherited operations do never dispatch because S inheriting to T is a plain type. Dispatch happens strictly on T'Class. No polymorphic objects, no dispatch. > As Ludovic said (I agree with what he said), most of time, things can > be done another way. I don't think so. I have an impression that Ludovic mixes S inheriting to T with the use of both S and T within T'Class. The first does not imply the second. It only makes the second possible. But if you do not need T'Class nobody forces you to use it in Ada, unlikely to other OO languages. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de