comp.lang.ada
 help / color / mirror / Atom feed
From: Jere <jhb.chat@gmail.com>
Subject: Re: Anonymous Access and Accessibility Levels
Date: Wed, 24 Apr 2019 03:34:00 -0700 (PDT)
Date: 2019-04-24T03:34:00-07:00	[thread overview]
Message-ID: <36b410ba-146f-48f4-a759-6ba12072ea0a@googlegroups.com> (raw)
In-Reply-To: <q9le67$cc0$1@franka.jacob-sparre.dk>

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.


  parent reply	other threads:[~2019-04-24 10:34 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-20 15:29 Anonymous Access and Accessibility Levels Jere
2019-04-20 15:58 ` J-P. Rosen
2019-04-22 22:03   ` Randy Brukardt
2019-04-24 10:42   ` Jere
2019-04-24 23:27     ` Randy Brukardt
2019-04-26  2:47       ` Optikos
2019-05-11 11:58         ` Jere
2019-04-26 17:12     ` G.B.
2019-05-11 12:06       ` Jere
2019-05-14  0:03         ` Randy Brukardt
2019-04-22 22:11 ` Randy Brukardt
2019-04-22 22:23   ` Shark8
2019-04-23 23:42     ` Randy Brukardt
2019-04-23  7:44   ` Dmitry A. Kazakov
2019-04-23 23:47     ` Randy Brukardt
2019-04-24 10:34   ` Jere [this message]
2019-04-24 10:44     ` Jere
2019-04-24 23:21       ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox