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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c7d1d12d1859ad7f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-07 11:56:10 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!gw1.att.com!csn!yuma!purdue!lerc.nasa.gov!magnus.acs.ohio-state.edu!math.ohio-state.edu!howland.reston.ans.net!gatech!paladin.american.edu!auvm!GTEWD.MTV.GTEGSC.COM!papayd Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Newsgroups: comp.lang.ada Message-ID: <0098BA0A.437E2700.4@gtewd.mtv.gtegsc.com> Date: Tue, 7 Feb 1995 11:56:10 PST Sender: Ada programming language From: Dave Papay M/S 7G32 x2791 Subject: Re: An Ada9X mimic of C++ friends? Date: 1995-02-07T11:56:10-08:00 List-Id: Donald M Needham write: > >Is there a construct in Ada9x that circumvents data abstraction >similar to a friend in C++? > >needham@brc.uconn.edu An Ada95 child package has visibility to the private part of its parent, thus "circumventing" the data abstraction created by private types. An interesting difference is that in C++, a class declares who its fiends are, while in Ada95, a package declares itself as a child of the parent. There are both public and private children. In a public child, the information in the private part of the parent is only visibile in the private part (and corresponding package body, if any) of the child. Thus, the public child cannot "export" this information. In a private child, the information in the private part of the parent is visible in all places. However, private units cannot be 'with'ed outside of the hierarchy rooted at the parent unit, so they too cannot export this information. This explanation is not precise, and is off the top of my head, so I'm sure I've missed many of the finer details. But it does cover the basic ideas, and will give you a good starting point to work with. | | David Papay | o | papay@acm.org (preferred) | ^/--- | insert your favorite dpapay@aol.com (alternate) | /> | disclaimer here | | | fleche! |