comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Anonymous access types are evil, why?
Date: Wed, 28 Aug 2013 16:10:13 -0500
Date: 2013-08-28T16:10:13-05:00	[thread overview]
Message-ID: <kvlovn$v0d$1@loke.gir.dk> (raw)
In-Reply-To: 66f24ada-122c-4c01-9f04-5bc92233a456@googlegroups.com

"Adam Beneschan" <adambeneschan@aol.com> wrote in message 
news:66f24ada-122c-4c01-9f04-5bc92233a456@googlegroups.com...
...
>> 2. Avoid anonymous access types. Prefer named access types and 
>> 'Unchecked_Access.
>
>I hope we don't have to draw this conclusion.  It would be sad if, with our 
>right hand,
>we're urging people to adopt Ada because of its safety, and then with our 
>left hand
>we recommend that they use 'Unchecked_Access and defeat the safety 
>mechanism.

Not sure why preferring named access types would imply anything about 
'Access or 'Unchecked_Access. If you're using either of those, you almost 
never have a choice - you almost always have to use 'Unchecked_Access. But 
you shouldn't have to use either, as Ada allows explicit conversion of 
structurally similar access types. You need named types in order to use 
structural conversion, of course.

Certainly "avoid anonymous access types" is good advice, not the least of 
which that they usually imply run-time accessibility checking overhead, 
which is never needed for named access types.

                          Randy.




  reply	other threads:[~2013-08-28 21:10 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 [this message]
2013-08-30  7:29   ` ake.ragnar.dahlgren
2013-08-30 15:17     ` Adam Beneschan
2013-08-30 17:04       ` Robert A Duff
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