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,5dacec64c8c879fa X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.68.222.71 with SMTP id qk7mr15168801pbc.1.1328650219096; Tue, 07 Feb 2012 13:30:19 -0800 (PST) Path: lh20ni271836pbb.0!nntp.google.com!news1.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Preventing Unchecked_Deallocation? Date: Tue, 07 Feb 2012 16:30:18 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <33a35da4-6c3e-4ab4-b58f-a9d73565d79a@t30g2000vbx.googlegroups.com> <4350713b-6ac3-4b22-b221-8da2bac52fea@t5g2000yqk.googlegroups.com> <26e4f2a4-edae-4e37-8697-f2390e636a21@z31g2000vbt.googlegroups.com> <07915db7-0e84-4eb5-af69-ee31e10b018f@db5g2000vbb.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1328650218 23044 192.74.137.71 (7 Feb 2012 21:30:18 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 7 Feb 2012 21:30:18 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:94pduY7TZpk0U2QlbS0Xch0z2H4= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: 2012-02-07T16:30:18-05:00 List-Id: Simon Belmont writes: > On Feb 7, 6:42�am, Gautier write-only > wrote: > >> ...in 99% of the cases you don't even need accesses at all I'm not sure what that means. 99% of what cases? I mean, there are lots of "cases" where you would use an integer, or an array, or a procedure, or an if_statement, rather than an access type. Anyway, whether pointers are needed rarely or often depends on the application area. > Can you explain this further? I can envision many more than 1% of > situations where they would be needed, which means I am probably still > stuck in another languages mentality. If X and Y must both call > primitive operations of Z, then what other options are there? I don't understand that last sentence. You don't need pointers (access types) to call primitive operations. In Ada, you need pointers if you want to create linked heap-allocated data structures. In the kinds of program I write, that happens often. You also need pointers if you want to implement size-changing objects. Not for much else. It's often a good idea to hide the pointers away in a package, rather than scattering them all over the program. - Bob