comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Polymorphism
Date: Mon, 11 May 2015 20:29:49 -0500
Date: 2015-05-11T20:29:49-05:00	[thread overview]
Message-ID: <mirl2d$mij$1@loke.gir.dk> (raw)
In-Reply-To: d0b830a1-19c8-462e-b1c8-a2b19e470674@googlegroups.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1123 bytes --]

"slos" <new.stephane.los@gmail.com> wrote in message 
news:d0b830a1-19c8-462e-b1c8-a2b19e470674@googlegroups.com...
Le jeudi 7 mai 2015 21:09:33 UTC+2, Randy Brukardt a écrit :
...
> If I remember correctly, I should have verified before posting but it's 
> already
> late, in C++ one can have protected members which can be used by friends.
> I can't see in Ada such thing like protected stuff and friends. Maybe 
> there is ?

Ada uses child packages for that sort of functionality; to be a "friend" in 
Ada, a package has to be a child. Often, a parent and set of children is 
referred to as a "subsystem". [Private packages also can be part of a 
subsystem, that's where they're useful.] Unrestricted use of friends 
appeared to lead to madness (at a minimum, visibility madness), where 
dependencies go all which ways. Ada limits such dependencies to a single 
subsystem. (Generally, one wants to minimize dependences.)

...
>I am quite happy with the child package solution exposed here by Simon
>but then that has disturbed my packages hierarchy... ;-)

Yup. There's no free lunch. ;-)

                     Randy.


  reply	other threads:[~2015-05-12  1:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-06 23:05 Polymorphism slos
2015-05-07  7:28 ` Polymorphism Simon Wright
2015-05-07  8:32   ` Polymorphism slos
2015-05-07  7:41 ` Polymorphism Dmitry A. Kazakov
2015-05-07  8:34   ` Polymorphism slos
2015-05-07 19:09   ` Polymorphism Randy Brukardt
2015-05-11 22:05     ` Polymorphism slos
2015-05-12  1:29       ` Randy Brukardt [this message]
2015-05-14 21:34         ` Polymorphism slos
  -- strict thread matches above, loose matches on Subject: below --
1996-11-25  0:00 polymorphism W. Wesley Groleau (Wes)
replies disabled

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