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,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-29 00:37:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. Date: Wed, 29 Jan 2003 09:37:02 +0100 Message-ID: References: <1043339266.922562@master.nyc.kbcfp.com> <7iLY9.2401$qb1.464@nwrddc01.gnilink.net> <1043680098.61106@master.nyc.kbcfp.com> <3afc3v4uur2kvd53v4ul18b5npjfm188o3@4ax.com> <1043773909.385612@master.nyc.kbcfp.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: fu-berlin.de 1043829423 32585435 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:33542 Date: 2003-01-29T09:37:02+01:00 List-Id: On Tue, 28 Jan 2003 12:11:50 -0500, Hyman Rosen wrote: >Dmitry A. Kazakov wrote: >> But that's another thing. Here, Circle cannot use (inherit) the >> methods of Ellipse. It inherits only the abstract methods of >> EliipseInterface and thus, have to implement all of them for scratch. >> This kills the whole idea of inheritance for code reuse. > >It's just the way I wrote it here, because I figured Circle >didn't need to store two doubles, just one. It could have >inherited directly from Ellipse if I'd wanted it that way: That's the whole point. We want to inherit from Ellipse (non-abstract) some of its methods, but we do not want to inherit the representation (two doubles). Of course, if you change the representation, you lose view conversions and thus an ability to pass Circle by-reference where an Ellipse is required. You have to pass it by-copy instead. C++ cannot this, it lacks in out parameters, but Ada well can. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de