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,56131a5c3acc678e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-08 00:42:30 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news.state.mn.us!arclight.uoregon.edu!hammer.uoregon.edu!logbridge.uoregon.edu!newshub.sdsu.edu!small1.nntp.aus1.giganews.com!nntp.giganews.com!cyclone1.gnilink.net!spamkiller2.gnilink.net!nwrdny01.gnilink.net.POSTED!53ab2750!not-for-mail From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 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: Date: Mon, 08 Dec 2003 08:42:28 GMT NNTP-Posting-Host: 162.84.211.17 X-Complaints-To: abuse@verizon.net X-Trace: nwrdny01.gnilink.net 1070872948 162.84.211.17 (Mon, 08 Dec 2003 03:42:28 EST) NNTP-Posting-Date: Mon, 08 Dec 2003 03:42:28 EST Xref: archiver1.google.com comp.lang.ada:3219 Date: 2003-12-08T08:42:28+00:00 List-Id: 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. > 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. > 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?