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: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.stack.nl!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Anonymous access types are evil, why? Date: Wed, 28 Aug 2013 16:10:13 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <66f24ada-122c-4c01-9f04-5bc92233a456@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1377724216 31757 69.95.181.76 (28 Aug 2013 21:10:16 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 28 Aug 2013 21:10:16 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:17031 Date: 2013-08-28T16:10:13-05:00 List-Id: "Adam Beneschan" wrote in message news:66f24ada-122c-4c01-9f04-5bc92233a456@googlegroups.com... ... >> 2. Avoid anonymous access types. Prefer named access types and >> 'Unchecked_Access. > >I hope we don't have to draw this conclusion. It would be sad if, with our >right hand, >we're urging people to adopt Ada because of its safety, and then with our >left hand >we recommend that they use 'Unchecked_Access and defeat the safety >mechanism. Not sure why preferring named access types would imply anything about 'Access or 'Unchecked_Access. If you're using either of those, you almost never have a choice - you almost always have to use 'Unchecked_Access. But you shouldn't have to use either, as Ada allows explicit conversion of structurally similar access types. You need named types in order to use structural conversion, of course. Certainly "avoid anonymous access types" is good advice, not the least of which that they usually imply run-time accessibility checking overhead, which is never needed for named access types. Randy.