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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4885c546f6ddc77a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.190.104 with SMTP id gp8mr1446685pbc.4.1340326192431; Thu, 21 Jun 2012 17:49:52 -0700 (PDT) Path: l9ni5049pbj.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: sbelmont700@gmail.com Newsgroups: comp.lang.ada Subject: Re: Dynamic accessibility Date: Thu, 21 Jun 2012 17:43:23 -0700 (PDT) Organization: http://groups.google.com Message-ID: <192bee3d-c0d4-421d-b5f6-676bce2a38db@googlegroups.com> References: NNTP-Posting-Host: 206.53.78.59 Mime-Version: 1.0 X-Trace: posting.google.com 1340326192 3334 127.0.0.1 (22 Jun 2012 00:49:52 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 22 Jun 2012 00:49:52 +0000 (UTC) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=206.53.78.59; posting-account=ShYTIAoAAABytvcS76ZrG9GdaV-nXYKy User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-06-21T17:43:23-07:00 List-Id: 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= =20 > "tripping hazard" -- you might get an exception from a few calls, but not= =20 > others. It's especially bad as calls from unit tests most likely will wor= k=20 > (they're not nested) while ones in actual programs might (calls in nested= =20 > subprograms are much more common). This was my real concern with the access parameter accessibility; the excep= tion 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 cas= e 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 backwar= ds 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 appreciat= ed; thank you for your continued help and support. -sb