comp.lang.ada
 help / color / mirror / Atom feed
From: Dave Papay M/S 7G32 x2791 <papayd@GTEWD.MTV.GTEGSC.COM>
Subject: Re: An Ada9X mimic of C++ friends?
Date: Tue, 7 Feb 1995 11:56:10 PST
Date: 1995-02-07T11:56:10-08:00	[thread overview]
Message-ID: <0098BA0A.437E2700.4@gtewd.mtv.gtegsc.com> (raw)

Donald M Needham <needham@NEWSSERVER.UCONN.EDU> 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! |



             reply	other threads:[~1995-02-07 19:56 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-02-07 19:56 Dave Papay M/S 7G32 x2791 [this message]
  -- strict thread matches above, loose matches on Subject: below --
1995-02-07 13:55 An Ada9X mimic of C++ friends? Donald M Needham
1995-02-07 22:38 ` David Weller
1995-02-08  9:32 ` Michel Gauthier
1995-02-08 16:27 ` Cyrille Comar
1995-02-09  5:55   ` John Howard
1995-02-09  9:59     ` Stephane Barbey
1995-02-09 21:16     ` Norman H. Cohen
1995-02-10 23:11     ` Cyrille Comar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox