comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: Conversion of Access Types Question
Date: 1999/01/20
Date: 1999-01-20T00:00:00+00:00	[thread overview]
Message-ID: <m390ex6fd3.fsf@mheaney.ni.net> (raw)
In-Reply-To: wccu2xmq6k3.fsf@world.std.com

Robert A Duff <bobduff@world.std.com> writes:

> dewar@gnat.com writes:
> 
> > This is a very common misunderstanding in Ada 95, which is
> > why we recently added the second message, since it is
> > almost certain to be the right fix. Some Ada 95 programmers
> > simply make a rule of using "ALL" for all access types.
> 
> In retrospect, I think the distinction between the two kinds of access
> types (with and without "all") is not useful enough to have in the
> language.  It's a little bit useful, but as you can see, it causes
> confusion.  It would have been better to simply make all access types
> behave like the "all" kind, and get rid of the "all" syntax.
> 
> That's what Tucker wanted to do in the first place, by the way.
> He was convinced otherwise, partly by me.  :-(


That's what you said back on 1996/05/24 too:

(start of old post)

Re: Type conversion between access types (was: Free'ing extended types)

In article <leschkes.832959439@ferret>,
Scott Leschke <leschkes@ferret.cig.mot.com> wrote:

>I have noticed that in most of the code I've seen, all is used pretty
>liberally would makes me wonder about the benefit of making the
>distinction between pool and general accesss types myself.  I have
>wondered if it may have been better to have the distinction go the
>other way if indeed a distinction was warranted (ie. general and
>non-pool based).

I admit, with 20-20 hindsight, that the 'all' thing was a mistake.  I
pushed for the idea during the design of Ada 9X, because I thought this
efficiency distinction was important.  Tucker, on the other hand,
thought that all access types should be 'all'.  He was right; I was
wrong.

(end of old post)


I completely agree; I just use general access types everywhere.  It's
been my experience that in practice, when writing abstractions that have
flexible memory management schemes, you end up having to declare all the
access types to be general access types anyway.  So why make the
distinction?

And think about the inconsistency with access parameters: you don't make
the distinction there.  Worse, there is no "access constant" parameter,
which we really do need.  (Now, without access constant parameters, we
have to resort to back-door hacks using an in param instead, thus losing
the scope-checks that the compiler would otherwise provide.)

And for what benefit was the distinction between general and
pool-specific access types made?  I think, to be able to have a
different representation for pool-specific types.  But, are there any
compilers that actually do have a different representation?  Couldn't
there have been another way to enable this alternate representation,
such as a pragma?

Adding "access all T" to the language complicates the language, adds
syntactic overhead, and makes this aspect of the language much harder to
learn and teach.

Matt





  reply	other threads:[~1999-01-20  0:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-01-14  0:00 Conversion of Access Types Question Paul S. Heidmann
1999-01-14  0:00 ` David C. Hoos, Sr.
1999-01-14  0:00   ` Paul S. Heidmann
1999-01-14  0:00     ` Tucker Taft
1999-01-14  0:00     ` David C. Hoos, Sr.
1999-01-15  0:00   ` dewar
1999-01-20  0:00     ` Robert A Duff
1999-01-20  0:00       ` Matthew Heaney [this message]
1999-01-20  0:00         ` Tucker Taft
1999-01-21  0:00         ` robert_dewar
1999-01-27  0:00         ` Nick Roberts
1999-01-28  0:00           ` robert_dewar
1999-01-21  0:00       ` robert_dewar
1999-01-21  0:00         ` Tom Moran
replies disabled

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