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-31 00:51:33 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.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: Fri, 31 Jan 2003 09:51:32 +0100 Message-ID: <7hdk3v82iaf4k65og9i9of903fjq2t5vhq@4ax.com> References: <7iLY9.2401$qb1.464@nwrddc01.gnilink.net> <1043680098.61106@master.nyc.kbcfp.com> <3afc3v4uur2kvd53v4ul18b5npjfm188o3@4ax.com> <1043773909.385612@master.nyc.kbcfp.com> <1043855067.848326@master.nyc.kbcfp.com> <1043938878.313737@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 1044003092 34470763 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:33633 Date: 2003-01-31T09:51:32+01:00 List-Id: On 30 Jan 2003 12:12:01 -0500, Stephen Leake wrote: >Dmitry A. Kazakov writes: > >> On Thu, 30 Jan 2003 10:01:18 -0500, Hyman Rosen >> wrote: >> >> >Dmitry A. Kazakov wrote: >> >> On Wed, 29 Jan 2003 10:44:27 -0500, Hyman Rosen >> >> wrote: >> >>>If you want to inherit method implementation, how can >> >>>this not be tied to object representation? >> >> >> >> Why should it be? When you do fabs (-100), do you care whether -100 >> >> has same represenation as a double? >> > >> >When I *implement* fabs, I most certainly care about the >> >data representation! >> >> But you don't. It is already here. You just reuse it, because int is >> to some extent a subtype of double. > >He said "implement", not "reuse". Please don't confuse the issue. But in my example it was not implementation, but reuse. fabs is defined on double. >To _implement_ fabs, you need to know the format of a floating point >number, so you know which bit to flip. [ In fact no, because fabs can be implemented in terms of other operations ] >To _implement_ "area" for a circle, you need to know whether it is a >special case of ellipse (so the 'radius' is named 'minor_axis') or is >a separate type (so the 'radius' is named 'radius'). I can *either* implement Circle.Area *or* inherit (so, reuse) it from Ellipse. In the latter case I have to know nothing, because Circle is substitutable in Ellipse.Area. >Perhaps you can show some code that demonstrates what you are talking >about. The question was: do we [programmers] need to know the representation when we inherit a method? The answer is NO. [Of course, the way the compiler implements inheritance of a method depends on the representations of both types, but the programmer should not care about it.] --- Regards, Dmitry Kazakov www.dmitry-kazakov.de