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=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Visibility issue Date: Wed, 16 Sep 2020 09:14:19 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <27269975-58eb-407b-98ca-344bee6894d2n@googlegroups.com> NNTP-Posting-Host: 2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:60156 List-Id: On 15/09/2020 21:35, Daniel wrote: > El lunes, 14 de septiembre de 2020 a las 16:42:26 UTC+2, Dmitry A. Kazakov escribió: >> task body Caller is >> My_Handle : Handle := Create (6); > Dmitry, let me paste my answer i give to Jeff as an introduction to explain better the problem. First of all, I want to thank you to point me to different options. I will think about to refactoring everything i have or even build from scratch if I'm not able to build from what i already have. > > For the requirements, It's not a problem to have a public constructor for the handle, in fact, i will need one for users. The real problem is to have constructors or function that i need to be visible from implementing packages and at the same time NOT visible from users that only are allowed to do a "with API.XXX" > > I have the next requirements: > - I need to pack all calls from users in just one Package API Hierarchy. > - The details and complexity of the implementation needs to be outside of this API hierarchy as much as possible. > -I need to use tagged types as much as possible for the calls from users to API package. (I'm not a big fan of this also but its a requirement) > -This API tagged types needs to connect the API Side with the implementation packages. > -The user needs to set a limited number of callback procedure with this flavor: "Procedure (S : in out Tagged_APi_Type)" > -The Implementation package needs to trigger the procedure defined in the API. (Here comes to problems): > -->The implementation package needs to manipulate some hide part of the Tagged_API_Type when is triggered > ------>Here comes the problem. From the implementing package is not possible to see the private part of the API package. I think because visibility is not related to type, is related to package where package exists. That is OK, but the hidden part need to be constructed in some way. Your requirements are silent about how. There exist only two possibilities, it is either generated internally or else provided by the client externally in some form, e.g. as parameters for the constructing function. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de