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: Thu, 17 Sep 2020 18:47:02 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <27269975-58eb-407b-98ca-344bee6894d2n@googlegroups.com> <28481dfd-7127-4106-bcfd-f085ffbf228fn@googlegroups.com> <574318ce-0624-4893-8718-37f2e97736b7n@googlegroups.com> <72104242-209f-4821-912e-f2191764f80an@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 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader02.eternal-september.org comp.lang.ada:60185 List-Id: On 17/09/2020 17:32, Daniel wrote: > El jueves, 17 de septiembre de 2020 a las 17:00:38 UTC+2, Dmitry A. Kazakov escribió: >> On 17/09/2020 15:31, Daniel wrote: >>> El miércoles, 16 de septiembre de 2020 a las 23:48:34 UTC+2, Simon Wright escribió: >>>> I still don't understand _why_. >>> ¿Why a tagged type in a callback function to send data to users? >>> It wasn't my decision. It's an imposed requirement. >>> (...yes sometimes I don't understand some requirements/limitations neither.) >>> >>>> Purely from the visibility aspect, >>>> >>>> package API is >>>> function F return Integer; >>>> private >>>> Secret : constant := 42; >>>> end API; >>>> >>>> private package API.Impl is >>>> Altered : constant := Secret / 2; >>>> end API.Impl; >>>> >>>> with API.Impl; >>>> package body API is >>>> function F return Integer is (Impl.Altered); >>>> end API; >>> >>> ok Lets try to fit this requirement: >>>> "There will be one or more internal packages not visible to users where information is created. Preferably not in API hierarchy" >> 1. API.Impl is not in the public hierarchy of API. > Sadly requirement says to dont be neither public or private hierarchy part of the API. Private child has exactly same semantic as the private part of API package. A requirement cannot forbid one yet allow another. If it does fire the guy who wrote it for incompetence. >> 2. Alternatively rename API.Impl into API_Impl. Move all secrets from >> API to API_Impl. Use API_Impl with the body of API. package API is ... end API; with API_Impl; package body API is ... end API; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de