comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Preventing Unchecked_Deallocation?
Date: Tue, 07 Feb 2012 16:30:18 -0500
Date: 2012-02-07T16:30:18-05:00	[thread overview]
Message-ID: <wcczkcu2uxh.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: ad11f6f6-f997-4d1d-a7cc-b7d3e333fdf9@f14g2000yqe.googlegroups.com

Simon Belmont <sbelmont700@gmail.com> writes:

> On Feb 7, 6:42�am, Gautier write-only <gautier_niou...@hotmail.com>
> 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



  reply	other threads:[~2012-02-07 21:30 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-02 23:41 Preventing Unchecked_Deallocation? Simon Belmont
2012-02-04 14:40 ` AdaMagica
2012-02-05 16:42   ` Simon Belmont
2012-02-06 12:52     ` Julian Leyh
2012-02-06 16:05       ` Adam Beneschan
2012-02-06 16:21     ` Adam Beneschan
2012-02-06 18:34       ` AdaMagica
2012-02-07  0:14       ` Simon Belmont
2012-02-07  2:19         ` Shark8
2012-02-07 16:39           ` Robert A Duff
2012-02-07 11:42         ` Gautier write-only
2012-02-07 21:11           ` Simon Belmont
2012-02-07 21:30             ` Robert A Duff [this message]
2012-02-07 22:23               ` Simon Wright
2012-02-07 23:07                 ` Robert A Duff
2012-02-08  8:43                   ` Simon Wright
2012-02-08 15:06                     ` Robert A Duff
2012-02-09  2:22                     ` Randy Brukardt
2012-02-09  7:28                       ` Simon Wright
2012-02-07 23:06               ` Alan Copeland
2012-02-07 23:10                 ` Robert A Duff
2012-02-09  2:49         ` Randy Brukardt
2012-02-09  3:39           ` Jeffrey Carter
2012-02-09 15:47             ` Adam Beneschan
2012-02-09 19:16               ` Jeffrey Carter
2012-02-09  7:37           ` Simon Wright
2012-02-10  1:08             ` Randy Brukardt
2012-02-10  7:35               ` Simon Wright
2012-02-07  6:26     ` Jeffrey Carter
2012-02-08  8:49       ` Maciej Sobczak
2012-02-08 23:40         ` BrianG
2012-02-09  2:57         ` Randy Brukardt
2012-02-09  7:13           ` Pascal Obry
2012-02-10  1:12             ` Randy Brukardt
2012-02-09  8:08           ` Maciej Sobczak
2012-02-10  1:18             ` Randy Brukardt
2012-02-07 16:27     ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox