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.8 required=3.0 tests=BAYES_50,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.5-pre1 X-Received: by 2002:a05:620a:554:: with SMTP id o20mr29066806qko.205.1600349489398; Thu, 17 Sep 2020 06:31:29 -0700 (PDT) X-Received: by 2002:ac8:319d:: with SMTP id h29mr26537840qte.32.1600349489144; Thu, 17 Sep 2020 06:31:29 -0700 (PDT) Path: eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!tr3.eu1.usenetexpress.com!feeder.usenetexpress.com!tr2.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 17 Sep 2020 06:31:28 -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: <27269975-58eb-407b-98ca-344bee6894d2n@googlegroups.com> <28481dfd-7127-4106-bcfd-f085ffbf228fn@googlegroups.com> <574318ce-0624-4893-8718-37f2e97736b7n@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Visibility issue From: Daniel Injection-Date: Thu, 17 Sep 2020 13:31:29 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:60178 List-Id: El mi=C3=A9rcoles, 16 de septiembre de 2020 a las 23:48:34 UTC+2, Simon Wri= ght escribi=C3=B3: > I still don't understand _why_.=20 =C2=BFWhy 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,=20 >=20 > package API is=20 > function F return Integer;=20 > private=20 > Secret : constant :=3D 42;=20 > end API;=20 >=20 > private package API.Impl is=20 > Altered : constant :=3D Secret / 2;=20 > end API.Impl;=20 >=20 > with API.Impl;=20 > package body API is=20 > function F return Integer is (Impl.Altered);=20 > end API; ok Lets try to fit this requirement: >"There will be one or more internal packages not visible to users where in= formation is created. Preferably not in API hierarchy" Let's ignore for now "why" this requirement and how reasonable is it. For e= xample lets think for that the information comes from a data link implement= ed in other packages different to API. In your example, all data is generated and processed within API packages, b= ut the requirement obligates the data generated outside have to be send to = users through API elements. (API just process it, but not generate it) package Internal is Secret : Natural :=3D0; procedure Create_Data is begin Secret :=3DSecret + 1; end Create_Data; You need to give this Data to Users using API. Let's think in easy example = where Data gived to Users is Secret_Data / 2. =C2=BFHow is the better way to do it and in the same time not affect too mu= ch they way users see and use the API?