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,T_FILL_THIS_FORM_SHORT autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b8b8a54001adc4d2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!news-in.ntli.net!newsrout1-win.ntli.net!ntli.net!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.de!t-online.de!news.t-online.com!not-for-mail From: Martin Krischik Newsgroups: comp.lang.ada Subject: Re: Possible Ada deficiency? Date: Sun, 02 Jan 2005 18:49:01 +0100 Organization: None Message-ID: <1583282.MNpLsG3Aep@linux1.krischik.com> References: <1104516913.718856.94090@z14g2000cwz.googlegroups.com> <1104544963.930877.75170@c13g2000cwb.googlegroups.com> <2028056.4mBM3atrO1@linux1.krischik.com> <1104593266.794612.257170@z14g2000cwz.googlegroups.com> Reply-To: martin@krischik.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Trace: news.t-online.com 1104688831 05 30611 utubrAjJ1e3fpaf 050102 18:00:31 X-Complaints-To: usenet-abuse@t-online.de X-ID: bLbJqrZXree6MxQzvFBR1CRKwpdjyjkq1qjKGWXPMjoIPCUel-zVZn User-Agent: KNode/0.8.0 Xref: g2news1.google.com comp.lang.ada:7393 Date: 2005-01-02T18:49:01+01:00 List-Id: danmcleran@hotmail.com wrote: > >> just as anybody can type >> >> #define private public >> >> in C++. >> >> With Regards >> >> Martin > > Yes. This kind of thing is evil. Of course you can do the same in Ada using the "Cut/Copy/Paste" feature of you favourite Editor and Unchecked_Conversion. For the determined you can make it only more difficult. You know, after using C++ for a few years I started to create only classes like this: class X_self; class X { public: .......... private: X_self& X; }; Reason: The main incompatiblily problem is the result of the sizeof operator. And only opaque types can solve that. But then I have to agree that the C++ "private" has enormous marketing value. > One of the main reasons I find Ada so > appealing is that it has fewer loopholes for this kind of stuff to get > through. I am surprised that child packages have as much visibility as > they do, and that there is no way to prevent it, though. If you write a child package you should know what you are doing. Mind you, child packages where new for Ada 95. In Ada 83 there was only: package Parent package Child private end Child; private end Parent; package body Parent package body Child is seperate; end Parent; With this contruct you actualy know all possible child packages. There must have been a good reason why the new Child packages got access the private data as well. But then the old child packages even have access to the body informations. Martin -- mailto://krischik@users.sourceforge.net http://www.ada.krischik.com