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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.236.19.51 with SMTP id m39mr8812837yhm.31.1431639248051; Thu, 14 May 2015 14:34:08 -0700 (PDT) X-Received: by 10.140.97.7 with SMTP id l7mr125225qge.0.1431639248035; Thu, 14 May 2015 14:34:08 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!z60no368267qgd.1!news-out.google.com!k20ni9579qgd.0!nntp.google.com!z60no368266qgd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 14 May 2015 14:34:07 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=80.119.168.244; posting-account=O3LyFwoAAACc1uh60ZcOUmAGdDmGsEcV NNTP-Posting-Host: 80.119.168.244 References: <5hbl45anxasb.1jn73i00zgy2i.dlg@40tude.net> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <835a2cf7-0e27-4759-af80-8c93dc4f5a62@googlegroups.com> Subject: Re: Polymorphism From: slos Injection-Date: Thu, 14 May 2015 21:34:08 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:25882 Date: 2015-05-14T14:34:07-07:00 List-Id: Le mardi 12 mai 2015 03:29:50 UTC+2, Randy Brukardt a =E9crit=A0: > "slos" wrote in message=20 > news:... > Le jeudi 7 mai 2015 21:09:33 UTC+2, Randy Brukardt a =E9crit : > ... > > If I remember correctly, I should have verified before posting but it's= =20 > > already > > late, in C++ one can have protected members which can be used by friend= s. > > I can't see in Ada such thing like protected stuff and friends. Maybe= =20 > > there is ? >=20 > Ada uses child packages for that sort of functionality; to be a "friend" = in=20 > Ada, a package has to be a child. Often, a parent and set of children is= =20 > referred to as a "subsystem". [Private packages also can be part of a=20 > subsystem, that's where they're useful.] Unrestricted use of friends=20 > appeared to lead to madness (at a minimum, visibility madness), where=20 > dependencies go all which ways. Ada limits such dependencies to a single= =20 > subsystem. (Generally, one wants to minimize dependences.) >=20 > ... > >I am quite happy with the child package solution exposed here by Simon > >but then that has disturbed my packages hierarchy... ;-) >=20 > Yup. There's no free lunch. ;-) >=20 > Randy. Hello Randy, Thanks for your detailed information. In fact, I am very happy with the solution and it ends up quite understanda= ble, from my point of view... Since derived objects are children of their parent class, it seems logical = that the packages where they are defined are also children of those where t= heir parent is. That's only necessary if needed to access private attributes and methods bu= t it is maybe a good idea to do so in most cases since the package hierarch= y then mimics the objects hierarchy, isn't it ? Best Regards, St=E9phane http://slo-ist.fr/ada4autom