From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=BAYES_40,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:ac8:5d41:: with SMTP id g1mr3726020qtx.101.1599855451696; Fri, 11 Sep 2020 13:17:31 -0700 (PDT) X-Received: by 2002:a05:6214:48d:: with SMTP id ay13mr3768323qvb.103.1599855451502; Fri, 11 Sep 2020 13:17:31 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 11 Sep 2020 13:17:31 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: google-groups.googlegroups.com; posting-host=92.56.166.72; posting-account=C8J7NQoAAAD_ybGY7--QIRi6KpLjoH1Z NNTP-Posting-Host: 92.56.166.72 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6096c490-7112-415e-978b-fd4c78f28501n@googlegroups.com> Subject: Re: Visibility issue From: Daniel Injection-Date: Fri, 11 Sep 2020 20:17:31 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:60114 List-Id: El viernes, 11 de septiembre de 2020 a las 16:23:26 UTC+2, Jeffrey R. Carte= r escribi=C3=B3: > On 9/11/20 12:37 PM, Daniel wrote:=20 > >=20 > > package Library.Users is=20 > > type User_type is tagged with private;=20 > > procedure foo_public (S: User_Type);=20 > > private=20 > > type User_Type is tagged with record=20 > > hide_content_to_user : Natural;=20 > > end record;=20 > > function Access_to_hide_content return User_type;=20 > > end Library.Users;=20 > >=20 > > private with Library.Users;=20 > > package Internal_Library_Implementing is=20 > > -- Some internal public developer stuff=20 > > private=20 > > --Here I want to get access to User_Type hide content.=20 > > end Internal_Library_Implementing;=20 > >=20 > > I've tried using "private with" but gnat says the next:=20 > > move subprogram to the visible part (RM 3.9.3(10))=20 > > private function with tagged result must override visible-part function= =20 > >=20 > > Compiler says Im forced to make all private User_type functions public.= =20 > > So, are there more ways to see the hided content of this tagged type wi= thout extending the type itself in a child package? I needed to see this co= ntent outside of Library package. > The private part is only visible to the body and to child pkgs. So if you= declared=20 >=20 > private package Library.Users.Internal_Implementation is=20 >=20 > then it will be able to see the private part of Library.Users. Because it= 's a=20 > private pkg, it cannot be used by clients.=20 >=20 > --=20 > Jeff Carter=20 > "You couldn't catch clap in a brothel, silly English K...niggets."=20 > Monty Python & the Holy Grail=20 > 19 I was trying to separate the code in two hierarchies packages, one package = for an API and other package for internal implementation. IT's difficult to put the implementing details on the API "fake child" beca= use I will need a lot of dependencies from Internal packages hierarchy. It could be possible to use other solution different that put implementing = details on API packages?