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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2153d570c2f03e29 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.72.199 with SMTP id f7mr48396pav.12.1355789228207; Mon, 17 Dec 2012 16:07:08 -0800 (PST) MIME-Version: 1.0 Path: s9ni50706pbb.0!nntp.google.com!news.glorb.com!feeder.erje.net!us.feeder.erje.net!newsfeed.straub-nv.de!reality.xs3.de!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Question about library-level functions Date: Mon, 17 Dec 2012 18:07:05 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1355789227 31142 69.95.181.76 (18 Dec 2012 00:07:07 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 18 Dec 2012 00:07:07 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Date: 2012-12-17T18:07:05-06:00 List-Id: "AdaMagica" wrote in message news:a7a82a85-48e4-4ded-b090-06f62bd3b0b6@googlegroups.com... ... >Creating via anonymous access is evil - how can ou ever deallocate it? This >should be verboten by the language. A few too many words here: "anonymous access is evil" would have been enough. (At least for access-to-object.) The rules for accessibility (and thus finalization) are impossible to understand and typically require dynamic checks. Dynamic accessibility checks are surely evil, as they add overhead, create a "tripping hazard" (some uses are OK, others fail at runtime, which is not indicated by the specification), and only detect a minority of problems (most real uses have to resort to 'Unchecked_Access anyway). These types were a mistake in Ada 95 and expanding their use compounded the mistake. Too bad it wasn't obvious from the beginning. Vis-a-vis your original comment -- Ada 2012 at least gives restrictions that let users self-impose what the language does not: pragma Restrictions (No_Anonymous_Allocators); -- H.4(8.1/3) pragma Restrictions (No_Coextensions); -- H.4(8.2/3) pragma Restrictions (No_Access_Parameter_Allocators); -- H.4(8.3/3) Can't make these the default for compatibility reasons, of course. Randy.