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,6b6619eb9cada212 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Help me to chose between ADA 95 and C++ Date: 1999/12/14 Message-ID: <3856A1F5.4E360DC@averstar.com>#1/1 X-Deja-AN: 560663835 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <01bf37fb$a91afb60$0564a8c0@IS-D2D04C.test> <829rbv$a8m$1@nntp6.atl.mindspring.net> <01bf3e32$0b9dc880$022a6282@dieppe> <385112AE.7E2CFA9@rdel.co.uk> <38564CD6.F13F69FB@rdel.co.uk> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-12-14T00:00:00+00:00 List-Id: Stephen Leake wrote: > > Preben Randhol writes: > > > | Interestingly, many of the OO related pitfalls are evident in Ada 95 and > > | C++, because the way the two languages work is not actually that > > | different, for example attempting to override a method, but mis-typing > > | the name in the derived class making it a new method rather than an > > | overriden one. > > > > What is your solution to this? To me it sounds like the programmer > > does not proof-read his code if this is a _real_ problem. :-) > > I just wasted a couple of hours on a closely related problem, which I > propose we call "the snark effect" (see thread "hunting snarks"). I > changed the profile of the base type operation (one parameter changed > from "in out" to "access" to avoid an accesibility problem). But I > forgot to change one of the operations in one of the (many) derived > types. In similar situations, Ada catches such errors (ie, change spec > but forget to change body). I'd like Ada to catch this as well. A trio of pragmas have been proposed for eventual standardization that will allow the compiler to catch this problem. Basically you will be able to indicate whether a given operation is or is not presumed to override some inherited operation. See the following AI for details: http://www.ada-auth.org/cgi-bin-acats/cvsweb.cgi/AIs/AI-00218.DOC?rev=1.3 > > -- Stephe -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA