comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: have to use unrestricted access but just what about access
Date: Sat, 22 Jun 2002 00:49:56 GMT
Date: 2002-06-22T00:49:56+00:00	[thread overview]
Message-ID: <wcck7osuogb.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 5ee5b646.0206210345.2d58d8e0@posting.google.com

dewar@gnat.com (Robert Dewar) writes:

> Robert A Duff <bobduff@shell01.TheWorld.com> wrote in message news:<wccznxqni7o.fsf@shell01.TheWorld.com>...
> > "chris.danx" <spamoff.danx@ntlworld.com> writes:
> > 
> > > How can the unrestricted_access attribute be replaced by just access in the
> > > following code?
> > 
> > You should be using 'Unchecked_Access here, which is a standard feature
> > of Ada (albeit unsafe).
> > 
> > 'Unrestricted_Access is a feature of GNAT, and is not necessary in your
> > example.
> > 
> > - Bob
> 
> Bob look again!

> One of the nasty restrictions in Ada 95 is that you cannot make parameters
> aliased. This means that they can never be used in access attributes. This
> is indeed one use of unrestricted access that is useful and legitimate, though
> of course passing such an access value out assumes call by reference, and you
> have to be sure that you can gaurantee call by reference.

Oh.  I thought we were talking about a *component* of a parameter, where
the component was explicitly declared aliased.  Also, you can make a
parameter aliased by making it tagged.

I agree that this is a nasty restriction in Ada 95 -- one ought to be
allowed to declare the parameter aliased explicitly, and taggedness
shouldn't have anything to do with the matter.

- Bob



  reply	other threads:[~2002-06-22  0:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-19 23:32 have to use unrestricted access but just what about access chris.danx
2002-06-20  8:41 ` chris.danx
2002-06-20 12:10 ` SteveD
2002-06-20 14:22 ` Robert A Duff
2002-06-21 11:45   ` Robert Dewar
2002-06-22  0:49     ` Robert A Duff [this message]
2002-06-22  1:05       ` Ted Dennison
2002-06-22 12:09         ` Robert Dewar
2002-07-20  4:59     ` Craig Carey
2002-07-20 17:47       ` Robert A Duff
2002-07-21  8:45         ` Craig Carey
2002-06-20 16:05 ` Robert Dewar
2002-06-20 17:11   ` chris.danx
replies disabled

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