From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:e4ce:: with SMTP id o197-v6mr1721560ith.55.1532637063048; Thu, 26 Jul 2018 13:31:03 -0700 (PDT) X-Received: by 2002:aca:2b06:: with SMTP id i6-v6mr93061oik.0.1532637062797; Thu, 26 Jul 2018 13:31:02 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!1.eu.feeder.erje.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer03.am4!peer.am4.highwinds-media.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!d7-v6no1116700itj.0!news-out.google.com!k71-v6ni1226itk.0!nntp.google.com!d7-v6no1116696itj.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 26 Jul 2018 13:31:02 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:8c1:8400:84a3:54ff:1e86:76ed:b824; posting-account=lJ3JNwoAAAAQfH3VV9vttJLkThaxtTfC NNTP-Posting-Host: 2601:8c1:8400:84a3:54ff:1e86:76ed:b824 References: <40d568da-4715-42de-8e28-98da39a5c974@googlegroups.com> <34f499f7-020f-4dcc-adad-0ab1113386d1@googlegroups.com> <9d69e7b5-6b2d-4607-9f7b-affa78c41620@googlegroups.com> <41c711cb-0300-4a41-93d3-e69297ae1945@googlegroups.com> <42de4aa3-9e7c-44b8-aa84-712cc7ce03c6@googlegroups.com> <9b6b6f10-5956-4a19-83f5-c1c015c62602@googlegroups.com> <8720f70a-59b1-4297-b2fc-78804ec88b7b@googlegroups.com> <756cb66b-1ef8-4d9e-b679-118b6c59e89c@googlegroups.com> <1392b483-af72-4dbe-ad51-bd703405b7a8@googlegroups.com> <3eebe2fb-f066-4248-9b2f-1db32497fd82@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Visibility of Indexing aspects From: Shark8 Injection-Date: Thu, 26 Jul 2018 20:31:03 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 4620 X-Received-Body-CRC: 4181344565 Xref: reader02.eternal-september.org comp.lang.ada:53971 Date: 2018-07-26T13:31:02-07:00 List-Id: On Wednesday, July 25, 2018 at 6:12:24 PM UTC-6, Randy Brukardt wrote: > "Dan'l Miller" wrote in message > news:googlegroups.com... > On Wednesday, July 25, 2018 at 2:58:44 PM UTC-5, AdaMagica wrote: > >> Much ado about nothing. > >> > >> The writer of this code erroneously put things in the private part which > >> should have been public. There is a compiler bug leaking from privacy > >>which seduced the writer into thinking that his wrong code is correct. > >> > >> The RM is very precise about this, see the references in this thread. > >> > >> Love's Labours Lost with any further discussion. > > > >In other words, I made an insightful good point ... > > Sounds like babble to me. What's used by the client has to be public, > period. But this is legal: Package K is Type Example is private; Private Type Example is null record; For Example'Size use 4; End K; Package J is Type Hex is range 16#0#..16#F# with Size => 4; Type Ex_2 is record Item_1 : Hex; Item_2 : K.Example; end record with Size => 8; End J; > ... > >The _LRM_'s forcing of {Reference, Reference_Holder, Container_Array, ...} > >to be public declarations ... > > ...is perfectly fine -- there's nothing wrong or dangerous with using them > directly. Indeed, "indexing" is just a shorthand for a longer call involving > Reference -- you're always allowed to make the longer call, just like you > are allowed to put in .all even if you could have omitted it. We went to > substantial lengths to ensure that you can't keep a reference value longer > than the existence of the return object from Reference -- regardless of how > you use the package. (Telling people not to do something is never an > effective technique for safety!) But that's not the issue that is being cited in the original post. The issue is that all the indexing-attributes are declared/used in the private part and are [apparently] being used in the publicly visible part. Is this correct? Arguments could be made in either direction: (for-allowing) This allows the public declaration to be kept clean of generally non-relevant details; much like declaring stream input/output functions needn't be made explicitly public to work (due to the stream attributes being accessable). (for-disallowing) The indexable interface may not be intended for use outside of the PRIVATE visibility space (BODY, children's private, children's body).