comp.lang.ada
 help / color / mirror / Atom feed
From: Daniel <danielnorberto@gmail.com>
Subject: Re: Visibility issue
Date: Fri, 11 Sep 2020 13:17:31 -0700 (PDT)	[thread overview]
Message-ID: <6096c490-7112-415e-978b-fd4c78f28501n@googlegroups.com> (raw)
In-Reply-To: <rjg18s$uhq$1@dont-email.me>

El viernes, 11 de septiembre de 2020 a las 16:23:26 UTC+2, Jeffrey R. Carter escribió:
> On 9/11/20 12:37 PM, Daniel wrote: 
> > 
> > package Library.Users is 
> > type User_type is tagged with private; 
> > procedure foo_public (S: User_Type); 
> > private 
> > type User_Type is tagged with record 
> > hide_content_to_user : Natural; 
> > end record; 
> > function Access_to_hide_content return User_type; 
> > end Library.Users; 
> > 
> > private with Library.Users; 
> > package Internal_Library_Implementing is 
> > -- Some internal public developer stuff 
> > private 
> > --Here I want to get access to User_Type hide content. 
> > end Internal_Library_Implementing; 
> > 
> > I've tried using "private with" but gnat says the next: 
> > move subprogram to the visible part (RM 3.9.3(10)) 
> > private function with tagged result must override visible-part function 
> > 
> > Compiler says Im forced to make all private User_type functions public. 
> > So, are there more ways to see the hided content of this tagged type without extending the type itself in a child package? I needed to see this content outside of Library package.
> The private part is only visible to the body and to child pkgs. So if you declared 
> 
> private package Library.Users.Internal_Implementation is 
> 
> then it will be able to see the private part of Library.Users. Because it's a 
> private pkg, it cannot be used by clients. 
> 
> -- 
> Jeff Carter 
> "You couldn't catch clap in a brothel, silly English K...niggets." 
> Monty Python & the Holy Grail 
> 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" because 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?


  reply	other threads:[~2020-09-11 20:17 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 10:37 Visibility issue Daniel
2020-09-11 11:51 ` Maxim Reznik
2020-09-11 20:11   ` Daniel
2020-09-11 14:23 ` Jeffrey R. Carter
2020-09-11 20:17   ` Daniel [this message]
2020-09-11 22:36     ` Jeffrey R. Carter
2020-09-14 10:47       ` Daniel
2020-09-14 16:10         ` Jeffrey R. Carter
2020-09-15 19:11           ` Daniel
2020-09-15 20:03             ` Jeffrey R. Carter
2020-09-11 21:05 ` Dmitry A. Kazakov
2020-09-14 11:33   ` Daniel
2020-09-14 14:42     ` Dmitry A. Kazakov
2020-09-15 19:35       ` Daniel
2020-09-16  7:14         ` Dmitry A. Kazakov
2020-09-16 10:23           ` Daniel
2020-09-16 10:58             ` Dmitry A. Kazakov
2020-09-16 14:35               ` Daniel
2020-09-16 14:49                 ` Jeffrey R. Carter
2020-09-16 15:05                 ` Dmitry A. Kazakov
2020-09-16 20:09                   ` Daniel
2020-09-16 21:48                     ` Simon Wright
2020-09-17 13:31                       ` Daniel
2020-09-17 15:00                         ` Dmitry A. Kazakov
2020-09-17 15:32                           ` Daniel
2020-09-17 16:47                             ` Dmitry A. Kazakov
2020-09-18  8:05                         ` Simon Wright
2020-09-14 16:18 ` Simon Wright
2020-09-17 15:58 ` Jere
2020-09-17 16:10 ` Jere
2020-09-18  8:08   ` Simon Wright
2020-09-17 21:47 ` Shark8
replies disabled

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