From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Equivalence between named access and anonymous access. Date: Thu, 7 Sep 2023 02:20:02 +0200 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 7 Sep 2023 00:20:02 -0000 (UTC) Injection-Info: dont-email.me; posting-host="3de256addc8fe2de40e10a2bd4df6531"; logging-data="2741505"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/PNg1MkeYzfm1umE7yy8AZWdJm+aY0WE4=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Cancel-Lock: sha1:X0BtCsJG6jm1u1HUgkSKFulkL6E= In-Reply-To: Content-Language: en-US Xref: news.eternal-september.org comp.lang.ada:65609 List-Id: On 2023-09-06 16:37, Blady wrote: > > I'm wondering about named access and anonymous access. The rules for using access-to-object types are 1. Don't use access types 2. If you think you should use access types, see rule 1. 3. If you still think you should use access types, don't use anonymous access types 4. If you still think you should use anonymous access types, don't develop software The semantics of named access types are well defined and easily understood. The semantics of anonymous access types are defined in ARM 3.10.2, of which the AARM says "Subclause 3.10.2, home of the accessibility rules, is informally known as the 'Heart of Darkness' amongst the maintainers of Ada. Woe unto all who enter here (well, at least unto anyone that needs to understand any of these rules)." The ARG freely admits that no one understands 3.10.2, which means that what you get when you use anonymous access types is whatever the compiler writer thinks it says. This may differ between compilers and between different versions of the same compiler, and from what you think it says. So no sane person uses them. -- Jeff Carter “Companies who create critical applications—those with a low tolerance for risk—would do well to use Ada for those applications, even if they're more familiar with other languages like C and C++.” Mike Jelks 207