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,56131a5c3acc678e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-08 01:30:32 PST Path: archiver1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!tar-atanamir.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Question about OO programming in Ada Date: Mon, 08 Dec 2003 10:34:47 +0100 Message-ID: References: <5JmdnUF_9o_ABE-iRTvUrg@rapidnet.com> <1273941.m4G3ZzughP@linux1.krischik.com> NNTP-Posting-Host: tar-atanamir.cbb-automation.de (212.79.194.116) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1070875830 73616050 212.79.194.116 ([77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:3223 Date: 2003-12-08T10:34:47+01:00 List-Id: On Mon, 08 Dec 2003 08:42:28 GMT, Hyman Rosen wrote: >Chad Bremmon wrote: >> 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? C++ does not distinguish class-wide and specific types. The same object is treated as a class-wide or specific depending on the run-time call context. For example: class X { public : virtual void Foo (); virtual void Baz () { Foo (); } ... Is the call to Foo from Baz dispatching? The answer is, well, sometimes it will. Arguably C++ is not strongly typed because no type could be addressed to implicit "this" in Baz, and so to the actual type [*). In Ada one can always statically determine whether a call is dispatching. Unfortunately, this advantage remains largely unused because of redispatching support and embedded tags. ------- [*] "this" is a class-wide pointer when Baz was not directly or indirectly called from a constructor/destructor. It is a specific pointer otherwise. -- Regards, Dmitry Kazakov http://www.dmitry-kazakov.de