comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@gnat.com
Subject: Re: "out" or "access"
Date: 1998/10/31
Date: 1998-10-31T00:00:00+00:00	[thread overview]
Message-ID: <71dpa3$d76$1@nnrp1.dejanews.com> (raw)
In-Reply-To: wccpvb9vh0k.fsf@world.std.com

In article <wccpvb9vh0k.fsf@world.std.com>,
  Robert A Duff <bobduff@world.std.com> wrote:
> Matthew Heaney <matthew_heaney@acm.org> writes:
>
> > The RM also recommends that implementations "deliver a useful result"
> > when you take the O'Address of a by-reference type (tagged types,
> > limited types) passed as a subprogram parameter.  That's why
> > Sys.Addr_To_Acc_Conv can be used to work around this problem.
>
> I don't understand why you want to use 'Address at all.
> My earlier suggestion was to use 'Unchecked_Access.
> It has the same problem with possible dangling references,
> but at least it doesn't throw type checking completely out
> the window, as 'Address does.


Note that Unchecked_Access still has restrictions which can be annoying, it
cannot be applied to parameters for example, because it still requires the
object to be aliased. In GNAT, the Unrestricted_Access attribute can be used
anywhere 'Address is usable, and is comparable in effect, except that strong
typing of the resulting pointer is retained.

Robert Dewar
Ada Core Technologies

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  reply	other threads:[~1998-10-31  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-21  0:00 "out" or "access" =:-) Vincent
1998-10-21  0:00 ` dennison
1998-10-21  0:00 ` Tucker Taft
1998-10-22  0:00   ` Pascal Obry
1998-10-29  0:00     ` Robert A Duff
1998-10-29  0:00       ` Matthew Heaney
1998-10-29  0:00         ` Robert A Duff
1998-10-30  0:00           ` dennison
1998-10-30  0:00             ` Matthew Heaney
1998-10-30  0:00               ` Robert A Duff
1998-10-31  0:00                 ` dewar [this message]
1998-10-31  0:00                   ` Matthew Heaney
1998-10-31  0:00                 ` Matthew Heaney
1998-11-01  0:00                   ` Robert A Duff
1998-11-01  0:00                     ` Matthew Heaney
1998-11-01  0:00                       ` Robert A Duff
1998-11-02  0:00                         ` Matthew Heaney
1998-11-03  0:00                           ` Simon Wright
1998-11-16  0:00                             ` Matthew Heaney
1998-10-21  0:00 ` Jeff Carter
1998-10-21  0:00   ` Pat Rogers
1998-10-21  0:00     ` Martin C. Carlisle
1998-10-22  0:00       ` Pat Rogers
1998-10-22  0:00     ` 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