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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8b8748382fcfacc1 X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: friend classes in ada95 Date: 2000/04/15 Message-ID: <38F887AE.8CDA24E0@acm.org>#1/1 X-Deja-AN: 611550196 Content-Transfer-Encoding: 7bit References: <38F6B617.34E216A7@emw.ericsson.se> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 955815409 63.10.53.136 (Sat, 15 Apr 2000 09:16:49 PDT) Organization: EarthLink Inc. -- http://www.EarthLink.net MIME-Version: 1.0 Reply-To: jrcarter@acm.org NNTP-Posting-Date: Sat, 15 Apr 2000 09:16:49 PDT Newsgroups: comp.lang.ada Date: 2000-04-15T00:00:00+00:00 List-Id: Stefan Folkesson wrote: > > In ADA95, is there a way to make the private part of one class > accessable from another (see friend classes in C++)? >From ARM N.6: Class. A class is a set of types that is closed under derivation, which means that if a given type is in the class, then all types derived from that type are also in the class. The set of types of a class share common properties, such as their primitive operations. Therefore, classes do not have private parts. Packages, protected types, and task types have private parts. Others have answered the intent of your question ([private] child packages). I would just like to say that if you try to write C++ in Ada you will find it as ugly and difficult as trying to write Ada in C++. In C++, the class construct provides for type definition and extension, encapsulation, and information hiding. In Ada, packages provide for modularity, encapsulation, and information hiding, while the type system provides for type definition and extension. > Is this possible? Is there a pragma to supress the access check or do In general, unless you are doing something very low level, if you are considering suppressing or bypassing the language checks then you are going about something the wrong way. -- Jeff Carter "You tiny-brained wipers of other people's bottoms!" Monty Python & the Holy Grail