comp.lang.ada
 help / color / mirror / Atom feed
From: sbelmont700@gmail.com
Subject: Re: Dynamic accessibility
Date: Thu, 21 Jun 2012 17:43:23 -0700 (PDT)
Date: 2012-06-21T17:43:23-07:00	[thread overview]
Message-ID: <192bee3d-c0d4-421d-b5f6-676bce2a38db@googlegroups.com> (raw)
In-Reply-To: <jrvpvs$349$1@munin.nbi.dk>

On Thursday, June 21, 2012 2:43:06 PM UTC-4, Randy Brukardt wrote:
> Note that dynamic accessibility is always a bad idea, in that it provides 
> "tripping hazard" -- you might get an exception from a few calls, but not 
> others. It's especially bad as calls from unit tests most likely will work 
> (they're not nested) while ones in actual programs might (calls in nested 
> subprograms are much more common).

This was my real concern with the access parameter accessibility; the exception depends entirely on what the client passes in (though the rumor in Ada 2012 is that there exists a mechanism to compare accessibility levels, so that one might be able to conditionally typecast an access parameter...?).  It would seem a named type is preferable to an access parameter in any case in which assignment was necessary, especially in 2012 where there is not the 'in' parameter restriction for functions.  I'm sure there is an example I cannot think of, but what are the legitimate reasons someone would want to pass an access parameter and have occasion to cast it?  It seems backwards to provide a mechanism for ensuring assignment does not happen, and then implementing a workaround to allow it.

As always Mr. Brukardt, your responses are insightful and greatly appreciated; thank you for your continued help and support.

-sb



  reply	other threads:[~2012-06-22  0:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-13 21:31 Dynamic accessibility sbelmont700
2012-06-21 18:43 ` Randy Brukardt
2012-06-22  0:43   ` sbelmont700 [this message]
2012-06-22 20:03     ` Randy Brukardt
2012-06-24 16:51       ` sbelmont700
2012-06-26 22:53         ` 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