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-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: [OT] Re: Teaching new tricks to an old dog (C++ -->Ada) Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <42309456$1@news.broadpark.no> Date: Fri, 11 Mar 2005 10:46:20 +0100 Message-ID: <14yjz9dae7f3a.mvjoqmjg9v1f$.dlg@40tude.net> NNTP-Posting-Date: 11 Mar 2005 10:43:00 MET NNTP-Posting-Host: 010dbd40.newsread2.arcor-online.net X-Trace: DXC=Pg6\OL1`eB2F:^Y;boJ3Y0Q5U85hF6f;4jW\KbG]kaM8]kI_X=5Kea695ImeW[h1P2WRXZ37ga[7:n919Q4_`Vj9B8=X\UUgbk4 X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:9120 comp.lang.c++:45103 comp.realtime:1264 comp.software-eng:4831 Date: 2005-03-11T10:43:00+01:00 List-Id: On Thu, 10 Mar 2005 17:39:13 -0500, REH wrote: > Although I have to admit, I prefer C++'s OO model. > I find it easier (personally) to see the encapsulation, and Ada's > dispatching rules still confuse my. They are very simple. Dispatch happens only if the actual type is a class (=the specific type is unknown) and the formal type is not a class. BTW, C++ model of dispatch is inefficient and infeasible: 1. Small objects cannot be classes. Potentially, Ada can have Boolean classes. 2. Permanent re-dispatch no matter that the type is already resolved. 3. Clumsy rules about dispatching in ctors. There is no need in that. 4. No dispatch on result. 5. No way to implement multiple dispatch. >Can someone explain why they chose the > package as the encapsulation level for a class? Because class cannot be a holder of methods. It is unfeasible. Consider operations with many arguments. Methods do not belong to classes. > C++ features I would to have in Ada: > * Implicit instantiation. Yeah, I know, it can be unsafe, but that is one > thing I really like about C++: the ability to automate repetitive things. > * actually having a class object encapulating the data and methods. > * reference (in out) types in functions (without resorting to access types) > * meta-templates. very neat stuff. ugly, but neat. > * The STL!!! (though I hear something similar is coming?) I would like to eliminate generics in Ada in favor of better ADT. But I seem to be alone. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de