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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e5eb8ca5dcea2827 X-Google-Attributes: gid103376,public From: Hyman Rosen Subject: Re: Ada OO Mechanism Date: 1999/05/25 Message-ID: #1/1 X-Deja-AN: 481973877 Sender: hymie@calumny.jyacc.com References: <7i05aq$rgl$1@news.orbitworld.net> <7i17gj$1u1k@news2.newsguy.com> <7icgkg$k4q$1@nnrp1.deja.com> <3749E9EC.2842436A@aasaa.ofe.org> <7id2eo$fag@drn.newsguy.com> <3749FF7D.F17CE16A@aasaa.ofe.org> <374AC676.F7AE0772@lmco.com> X-Complaints-To: abuse@panix.com X-Trace: news.panix.com 927654027 15180 209.49.126.226 (25 May 1999 17:40:26 GMT) Organization: PANIX Public Access Internet and UNIX, NYC NNTP-Posting-Date: 25 May 1999 17:40:26 GMT Newsgroups: comp.lang.ada Date: 1999-05-25T17:40:26+00:00 List-Id: Mark A Biggar writes: > 1) It's not really part of the class as it has to be defined as > an external "friend" function. Friend functions and classes constitute parts of an interface. Some people would like to criticize C++ both for "requiring that everything be inside a class" and then again for using friends "which are not part of the class". They merely, or willfully, misunderstand the C++ model. > 2) It therefore CANNOT be made virtual so you can't dispatch on it. So you mean in Ada, I can write a dot(a,b) which will dispatch on either a or b? I wasn't aware that this was the case. I actually think that this is in fact *not* the case, in which case I have no trouble writing a dispatching version in C++ either - just have dot(a,b) call a.dot(b). In both Ada and C++, the apparent external symmetry will then hide the internal asymmetry. > 3) This also greatly complicates its use in generic (template) algorithms. > None of those problems exist in Ada. Once again, I will ask for an example demonstrating this, where something is more complicated to use in C++ generics than in Ada. This will make you the fourth person I have asked for this type of example, the others being Richard D. Riehle, Samuel Mize, and Robert Dewar. None of the others have chosen to post such an example.