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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,56131a5c3acc678e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-08 09:32:48 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!crtntx1-snh1.gtei.net!news.gtei.net!newsfeed1.easynews.com!easynews.com!easynews!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!intern1.nntp.aus1.giganews.com!nntp.giganews.com!nntp.rapidnet.com!news.rapidnet.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 08 Dec 2003 11:32:46 -0600 Date: Mon, 08 Dec 2003 11:27:31 -0600 From: Chad Bremmon Reply-To: bremmon@acm.org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Question about OO programming in Ada References: <5JmdnUF_9o_ABE-iRTvUrg@rapidnet.com> <1273941.m4G3ZzughP@linux1.krischik.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.13.119.27 X-Trace: sv3-Bmuq1neHjSSYTRyWN++XbZpH6Kt+F7YsuDyWnfRHPbLCGexm+jfLWbH7BLj+qQM6PiK2697vCZv0a4+!4krhJ38cLqYDb9LXWp2jgzYbNKkmpQ/KLo5YG5R2Ksim7DwjT+azzhO6jtruA3AWbSOpFohrJCe7 X-Complaints-To: abuse@rapidnet.com X-DMCA-Complaints-To: abuse@rapidnet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.1 Xref: archiver1.google.com comp.lang.ada:3229 Date: 2003-12-08T11:27:31-06:00 List-Id: Hyman Rosen wrote: > Chad Bremmon wrote: > >> Not true. A C++ Struct is the equivalent of an untagged Ada Type. > > > The only difference between "struct" and "class" in C++ is that the > former begins in public mode and the latter in private mode. A class has a parameter associated with it that is always passed to every function of that class. You can't see it. It's a compiler thing, but it's there. > >> Before a dispatch pointer is needed in Ada95, runtime polymorphism >> must be required. Otherwise, Ada95 always figures out the binding >> during compilation, because it always knows the type of the variable >> that is being passed to the appropriate function. To get to having >> runtime polymorphism, you must have a linked list of Tagged_Type'Class >> elements. > > > But Ada has separate compilation. The compiler can't decide that a > tagged type isn't ever going to need virtual dispatch just because > it hasn't seen an example of it yet. Yes it can, because if there is supposed to be inheritance, then there is a tagged type, which you can inherit from. I've explained to you how difficult it is to create a virtual dispatch at runtime. > >> Because Ada 95 is strongly typed, the compiler can figure out at >> compile time which function to call, based on the type. This ensures >> that dispatching is done during compile time. You still have the look >> and feel of polymorphism, without the non-deterministic nature of >> runtime dispatching. > > > What makes you think that C++ is any different in this regard? The reason I know what I'm talking about is because I have written programs that interface Ada95 and C++, and I know what's happening under the covers. If you would like to take some time to disassemble some C++ code and understand what YOU are talking about, feel free. Until then, I'm going to stop arguing with you. You, my friend, are the one who doesn't know what you're talking about.