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 X-Google-Thread: 103376,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-22 09:26:15 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!netaxs.com!newsread.com!feed2.newsreader.com!newsreader.com!newshosting.com!news-xfer2.atl.newshosting.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!uunet.MISMATCH!ash.uu.net!spool.news.uu.net!not-for-mail Date: Mon, 22 Sep 2003 12:26:14 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5b) Gecko/20030917 Thunderbird/0.3a X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Is the Writing on the Wall for Ada? References: <3F5F7FDC.30500@attbi.com> <3F6079A9.6080108@attbi.com> <3F60E380.4020307@attbi.com> <3F694186.5060709@crs4.it> <3F6F1688.9030903@attbi.com> In-Reply-To: <3F6F1688.9030903@attbi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Organization: KBC Financial Products Message-ID: <1064247974.78844@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@aphelion.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1064247974 21122 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:42753 Date: 2003-09-22T12:26:14-04:00 List-Id: Robert I. Eachus wrote: > If the states are independent, you can use mix-ins that add state, > but only see their own state variables. The problem with the mix-in approach is that you don't have a standalone "interface" type which represents the abilities granted by the mix-in. The problem I am formulating here is that you have multiple existing interface types, with existing concrete implementations. You would like to make a class which reuses the implementations and is of the interface types. I am talking of the Colorable+Resizable case, not the Polar+Cartesian case. > But if you want to inherit from two classes with state, and adjust > the state of each based on changes to the other, the na�ve implementation > isn't possible in Ada, and causes indefinite recursion in C++. struct A { int a; virtual void set_a(int aa) { a = aa; } }; struct B { int b; virtual void set_b(int bb) { b = bb; } }; struct AB : A, B { void set_a(int aa) { A::set_a(aa); B::set_b(aa + 1); } void set_b(int bb) { A::set_a(bb - 1); B::set_b(bb); } }; What indefinite recursion?