comp.lang.ada
 help / color / mirror / Atom feed
* An Ada9X mimic of C++ friends?
@ 1995-02-07 13:55 Donald M Needham
  1995-02-07 22:38 ` David Weller
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Donald M Needham @ 1995-02-07 13:55 UTC (permalink / raw)


Is there a construct in Ada9x that circumvents data abstraction
similar to a friend in C++?

needham@brc.uconn.edu




^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: An Ada9X mimic of C++ friends?
@ 1995-02-07 19:56 Dave Papay M/S 7G32 x2791
  0 siblings, 0 replies; 9+ messages in thread
From: Dave Papay M/S 7G32 x2791 @ 1995-02-07 19:56 UTC (permalink / 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! |



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~1995-02-10 23:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
1995-02-07 19:56 Dave Papay M/S 7G32 x2791

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