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,5dacec64c8c879fa X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.222.71 with SMTP id qk7mr770419pbc.1.1328775381525; Thu, 09 Feb 2012 00:16:21 -0800 (PST) Path: wr5ni4182pbc.0!nntp.google.com!news1.google.com!postnews.google.com!l1g2000vbc.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Preventing Unchecked_Deallocation? Date: Thu, 9 Feb 2012 00:08:43 -0800 (PST) Organization: http://groups.google.com Message-ID: <5d25ffd0-a73e-48c6-aac1-d5e3b00c4e0a@l1g2000vbc.googlegroups.com> References: <33a35da4-6c3e-4ab4-b58f-a9d73565d79a@t30g2000vbx.googlegroups.com> NNTP-Posting-Host: 83.3.40.82 Mime-Version: 1.0 X-Trace: posting.google.com 1328775381 30503 127.0.0.1 (9 Feb 2012 08:16:21 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 9 Feb 2012 08:16:21 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l1g2000vbc.googlegroups.com; posting-host=83.3.40.82; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-Header-Order: HUALESNKRC X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13,gzip(gfe) Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-02-09T00:08:43-08:00 List-Id: On 9 Lut, 03:57, "Randy Brukardt" wrote: > > The smart user will define his own access types and will make pointers > > from your objects at the nearest opportunity and there's lots of them > > if the type in question is, for example, tagged. > > There is absolutely no *requirement* to use access types with tagged types. Tagged types are aliased, which allows to obtain access values from their objects, now there is only one step to Unchecked_Deallocation. :-) And this is what I had in mind - it is not possible to completely defend against stupidity and if the user really wants, he will deallocate his own pointers to your own objects, even if you have no access types in your package specs. Putting it in other words: make something idiot proof and somebody will invent better idiots. Other than that, I fully agree that access types are not needed in Ada as much as they are in other languages. -- Maciej Sobczak * http://www.msobczak.com * http://www.inspirel.com