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:a02:694f:: with SMTP id e76mr9491184jac.111.1556102041325; Wed, 24 Apr 2019 03:34:01 -0700 (PDT) X-Received: by 2002:a9d:2c28:: with SMTP id f37mr17648797otb.126.1556102041133; Wed, 24 Apr 2019 03:34:01 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder6.news.weretis.net!feeder.usenetexpress.com!feeder-in1.iad1.usenetexpress.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!b2no124043itd.0!news-out.google.com!w17ni115itb.0!nntp.google.com!b2no124042itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 24 Apr 2019 03:34:00 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=70.109.61.2; posting-account=QF6XPQoAAABce2NyPxxDAaKdAkN6RgAf NNTP-Posting-Host: 70.109.61.2 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <36b410ba-146f-48f4-a759-6ba12072ea0a@googlegroups.com> Subject: Re: Anonymous Access and Accessibility Levels From: Jere Injection-Date: Wed, 24 Apr 2019 10:34:01 +0000 Content-Type: text/plain; charset="UTF-8" Xref: reader01.eternal-september.org comp.lang.ada:56182 Date: 2019-04-24T03:34:00-07:00 List-Id: On Monday, April 22, 2019 at 6:11:20 PM UTC-4, Randy Brukardt wrote: > "Jere" wrote in message > ... > > I think that D.The_T has an accessibility level relative to where > > an object of type D is declared? > > Yes, but there are special rules for allocators, for objects created as > return objects, and many other special cases. This area is not for the faint > of heart. In fact, it is only for those that like beating their heads > bloody. > > As always, I suggest the following rules: > > (1) Do not use anonymous access types unless you absolutely need one of the > special capabilities that can only be done with them. > (2) Under no circumstances, do anything that cannot be checked statically. > (So no one should use dynamic accessibility checks of anonymous access > parameters or SAOAATs). > (3) Think three times before depending upon access parameter dispatching and > anonymous access-to-subprograms. > (A) If you find that you really need these things, complain to the ARG > that you should be able to but cannot do these things with named access > types. (This limitation is idiotic, as it requires repeating long > declarations at every usage.) [I need help getting this fixed!!] > (4) Keep access types out of visible specifications (since they make memory > management much harder, and locks in clients to suboptimal memory > managment). > > Randy. I can appreciate that. I'm not talking about exposing any access types to the client. However, I am needing to use an access type and named access types are insufficient in this case. While I agree that compile time checking is preferred, Ada does not provide this capability in all cases and sometimes I have to rely on runtime checking (which I still believe is better than manual checking). In either case, I am still interested in understanding those specific things I asked earlier. In particular, if the issues I outlined in Test_AA_2 and Test_AA2 GNAT bugs or some special case rule that I am missing. Additionally, I was curious if assignment I highlighted in the main procedure was also a GNAT bug or a special rule. My gut says they are bugs, but I am not 100% sure.