comp.lang.ada
 help / color / mirror / Atom feed
From: Matthew Heaney <matthew_heaney@acm.org>
Subject: Re: "out" or "access"
Date: 1998/10/31
Date: 1998-10-31T00:00:00+00:00	[thread overview]
Message-ID: <m3u30lraoj.fsf@mheaney.ni.net> (raw)
In-Reply-To: 71dpa3$d76$1@nnrp1.dejanews.com

dewar@gnat.com writes:

> 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. 

I wish we could liberalize the rules here.  Right now, you can only
apply the Access attribute to an aliased object, which means the object
has to be publically tagged.

I've had to declare types as publically tagged --even though I don't
think the abstraction requires it-- because elsewhere I require an
aliased view.

It would be hipper if you were allowed to use the Access attribute for
objects whose _full_ view is limited or tagged, even if the partial
(public) isn't.

There's a precedent for this: the full view of a type in a generic
package may privately derive from Finalization.Controlled.  This means
instantations can only be done at library level.

This feature of the abstraction isn't stated publically stated -- the
compiler has to tell you at time of instantation.  Why not use a similar
rule for Unchecked_Access: you can only do it if the _full_ view of the
type is limited or tagged, irrespective of what the partial view says.


> 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.

This is a very nice attribute, but I've been loathe to use it, because
of potential portability problems.

It would be helpful if all vendors provided at least a weak form of the
Unrestricted_Access attribute.  For example, I don't really care about
downward closures.  But using it to effect type-safe conversion from an
access-to-constant into an access-to-variable seems pretty painless.




  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 ` 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
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                 ` 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-31  0:00                 ` dewar
1998-10-31  0:00                   ` Matthew Heaney [this message]
1998-10-21  0:00 ` dennison
replies disabled

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