comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Anonymous access types are evil, why?
Date: Fri, 30 Aug 2013 13:04:36 -0400
Date: 2013-08-30T13:04:36-04:00	[thread overview]
Message-ID: <wcchae72jq3.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: d86bf362-3b4b-48f7-8dfe-d88d5971ec2b@googlegroups.com

Adam Beneschan <adambeneschan@aol.com> writes:

> On Friday, August 30, 2013 12:29:17 AM UTC-7, ake.ragna...@gmail.com wrote:
>
>> Thanks for your analysis and especially the interesting result "an
>> allocator whose type is a named access type should be preferred over
>> an allocator whose type is anonymous".
>
> You're welcome, but I didn't mean for this to be taken as a general
> rule of Ada programming.  It looks like it's a helpful rule for this
> particular implementation (GNAT 2013), but I still don't know whether
> the implementation is correct or whether the extra overhead you're
> seeing is actually necessary.  It could be that this is a problem with
> GNAT, and they'll fix it, and that in the future there may not be a
> reason to prefer allocators whose types are named.  I just don't know.

I didn't look at the example -- I don't know if there's a GNAT bug or
not.  But I think "prefer named access types" is pretty good general
advice.  Anonymous access types have their uses, but they're pretty
special purpose.

"access T" is not just an innocuous shorthand for avoiding having to
name the access type.  Too bad.  Access types are one of the few places
where you usually want "by structure" type equivalence rather than "by
name".

- Bob

  reply	other threads:[~2013-08-30 17:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-28 11:49 Anonymous access types are evil, why? ake.ragnar.dahlgren
2013-08-28 16:10 ` Adam Beneschan
2013-08-28 21:10   ` Randy Brukardt
2013-08-30  7:29   ` ake.ragnar.dahlgren
2013-08-30 15:17     ` Adam Beneschan
2013-08-30 17:04       ` Robert A Duff [this message]
2013-08-28 20:16 ` sbelmont700
2013-08-28 21:10   ` Shark8
2013-08-30 16:16 ` Gerhard Rummel
replies disabled

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