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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca3.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: Accessibility checks Date: Wed, 17 Jul 2013 14:16:42 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <87mwplvthn.fsf@mid.deneb.enyo.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 17 Jul 2013 21:10:42 +0000 (UTC) Injection-Info: mx05.eternal-september.org; posting-host="68bb7ebc916066bb85146425b2aa8565"; logging-data="10838"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/s1Zff2hkVDQ0p042x/TRGzqDEXj+96W4=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <87mwplvthn.fsf@mid.deneb.enyo.de> Cancel-Lock: sha1:7KAycTfiUoACsBYLsK2h7F7AFNE= X-Original-Bytes: 2574 Xref: number.nntp.dca.giganews.com comp.lang.ada:182556 Date: 2013-07-17T14:16:42-07:00 List-Id: On 07/17/2013 01:09 PM, Florian Weimer wrote: > One thing in Ada I could never quite grasp where the accessiblity > checks. I haven't seen much Ada code, and personally, I didn't have > much need for nested access types anyway. If I have used them, they > were still potentially unsafe due to aliasing or calls to > Unchecked_Deallocation in neighboring code. > > So what's the point for this language feature? It seems to add quite > a bit of complexity to the language. Ada 83 didn't have these checks, and had only named access types that could only designate objects created by an allocator ("new"). Accessibility rules were introduced in Ada 95, along with general access types (declared with "all") that can access objects allocated on the stack, the 'Access and 'Unchecked_Access attributes, and anonymous access types in the forms of access parameters and access discriminants. Anonymous types are a Bad Idea, and anonymous access types are a Very Bad Idea. The language would be better off without them. Brukardt, ARG member and editor of the ARM, claims that 'Access never works and 'Unchecked_Access is always required, bypassing the accessibility checks. While this is not entirely true, it's quite common that one must use 'Unchecked_Access, so we could do without these rules and checks in the majority of cases. -- Jeff Carter "I unclog my nose towards you." Monty Python & the Holy Grail 11