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,1592759aa83d0d45 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-05-30 08:11:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!wn12feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!sccrnsc04.POSTED!not-for-mail From: "Mark A. Biggar" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3.1) Gecko/20030425 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: MI in Ada 200X References: <0Pxza.699607$OV.652508@rwcrnsc54> <4a4de33a.0305280557.5d5aba37@posting.google.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <9wKBa.1046187$F1.124536@sccrnsc04> NNTP-Posting-Host: 12.235.88.213 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc04 1054307461 12.235.88.213 (Fri, 30 May 2003 15:11:01 GMT) NNTP-Posting-Date: Fri, 30 May 2003 15:11:01 GMT Organization: AT&T Broadband Date: Fri, 30 May 2003 15:11:01 GMT Xref: archiver1.google.com comp.lang.ada:38105 Date: 2003-05-30T15:11:01+00:00 List-Id: Hyman Rosen wrote: > Dmitry A. Kazakov wrote: > >> Now consider a possibility that MI has a problem X. Then, obviously, >> either X is a problem of the concept of inheritance (1), or X is a >> problem of the language, implementation, our understanding etc (2). > > > MI has implementation difficulties that are distinct from SI, > related to the layout in memory of the pieces of the full object. > As I said, it is very instructive to check out the C++ ABI which > gcc uses. > MI also has the ambiguities with the diamond inheritance problem, which I have never seen a language solve in a non-clumsy way. Suppose we have the following example: type a is tagged ...; procedure op(x: a); type b is new a with ...; procedure op(x: b); type c is new a with ...; procedure op(x: C); type d is new a and b with ...; -- made up notation for Ada MI procedure op(x: d); Now for the ambiguities: 1) does d contain 1 or 2 copies of the fields of a? 2) if 2 how do you name them? 3) which version of op does d inherit? 4) the simple implementation (TAG is pointer to vtable, field offsets remain constant, etc.) becomes much more complicated. -- mark@biggar.org mark.a.biggar@attbi.com