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,FREEMAIL_FROM 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-02-03 05:25:08 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!newsswitch.lcs.mit.edu!newsfeed.cwix.com!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0901.news.uu.net!spool0900.news.uu.net!reader0902.news.uu.net!not-for-mail Date: Mon, 03 Feb 2003 08:11:26 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Anybody in US using ADA ? One silly idea.. References: <1043773909.385612@master.nyc.kbcfp.com> <1043855067.848326@master.nyc.kbcfp.com> <1043938878.313737@master.nyc.kbcfp.com> <1043949677.919365@master.nyc.kbcfp.com> <1044025904.464559@master.nyc.kbcfp.com> <1044033916.943076@master.nyc.kbcfp.com> <0c9s3vgk6hrt4t65sasn2jcr02jdjaspef@4ax.com> In-Reply-To: <0c9s3vgk6hrt4t65sasn2jcr02jdjaspef@4ax.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1044277886.972386@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@fixedcost.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1044277888 reader2.ash.ops.us.uu.net 19759 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:33720 Date: 2003-02-03T08:11:26-05:00 List-Id: Dmitry A. Kazakov wrote: > Yes, but in my why all this is same thing. Whether I write > subtype X is Y ; > or > type X is new Y with ; > I produce a new type Y substitutable for X. As your view conversion example showed, in the subtype case we don't have a substitution but a two-way conversion. It reminds me of school; the derived type is like a teacher who has gone to graduate school and has come back with new degrees while the subtype is like a substitute who fills in but doesn't know very much. > Isn't it strange, that 3 is available for methods, but not for data? I still don't understand how you propose to inherit method implementations while changing data representations. > Consider a simplier approach. I understand other approaches are possible, but as I keep saying, those are not the approaches used in the conventional languages which support OO, namely Ada, Java, C++, and probably Eiffel. Ada experts do often use a style where an object containing subobjects of type A, B, and C takes on the role of A, B, or C as needed, in order to simulate multiple inheritance. Maybe you can use something like that to do what you want?