comp.lang.ada
 help / color / mirror / Atom feed
* re: access all definitive
@ 1995-01-24 17:04 fintan
  1995-01-27  9:54 ` Michel Gauthier
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: fintan @ 1995-01-24 17:04 UTC (permalink / raw)


re: access all query

It seems that my interpretation of the 95 LRM was
correct and that the gnat implementation is yet to 
be correctly implemented. i.e. 

  an access all type can only designate an aliased
  variable and cannot designate a dynamic variable.

  an access variable is a la 83 and can only designate 
  a dynamic variable and cannot designate an aliased
  variable.

fintan

_____________________________________________________________
Fintan Culwin PhD
Senior Lecturer Software Engineering
School of Computing
South Bank University
Borough Road
London SE1 0AA

Phone (+44) (0)171 815 7434
Fax   (+44) (0)171 815 7499

fintan@vax.sbu.ac.uk






^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: access all definitive
  1995-01-24 17:04 access all definitive fintan
@ 1995-01-27  9:54 ` Michel Gauthier
  1995-01-28 19:48   ` Robert Dewar
  1995-01-28  5:36 ` Cyrille Comar
  1995-01-28  5:45 ` Robert Dewar
  2 siblings, 1 reply; 6+ messages in thread
From: Michel Gauthier @ 1995-01-27  9:54 UTC (permalink / raw)


In article <1995Jan24.170441.8957@vax.sbu.ac.uk>, fintan@vax.sbu.ac.uk wrote:

> re: access all query
> 
> [...]
> 
>   an access all type can only designate an aliased
>   variable and cannot designate a dynamic variable.
> 
>   an access variable is a la 83 and can only designate 
>   a dynamic variable and cannot designate an aliased
>   variable.

A dynamic variable a la 83 is intrinsicly aliased, with all
that can be implied by this property.

-- 
Michel Gauthier - Laboratoire d'informatique - 123 avenue Albert Thomas
F-87060 Limoges - fax +33()55457315
----- Are the messages that objects exchange also objects ? -----



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: access all definitive
  1995-01-24 17:04 access all definitive fintan
  1995-01-27  9:54 ` Michel Gauthier
@ 1995-01-28  5:36 ` Cyrille Comar
  1995-01-28  5:45 ` Robert Dewar
  2 siblings, 0 replies; 6+ messages in thread
From: Cyrille Comar @ 1995-01-28  5:36 UTC (permalink / raw)


fintan@vax.sbu.ac.uk writes:
: re: access all query
: 
: It seems that my interpretation of the 95 LRM was
: correct and that the gnat implementation is yet to 
: be correctly implemented. i.e. 
: 
maybe you could check the latest distributed GNAT (i.e. v2.02 ;-)
-- 
------------------------------------------------------------------------
Cyrille Comar,                                  E-mail: comar@cs.nyu.edu
Gnat Project                                    US phone: (212) 998-3489




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: access all definitive
  1995-01-24 17:04 access all definitive fintan
  1995-01-27  9:54 ` Michel Gauthier
  1995-01-28  5:36 ` Cyrille Comar
@ 1995-01-28  5:45 ` Robert Dewar
  2 siblings, 0 replies; 6+ messages in thread
From: Robert Dewar @ 1995-01-28  5:45 UTC (permalink / raw)


Just so Fintan doesn't lose too many sleepless nights worrying about
GNAT failing to diagnose this error :-)

     1. procedure a is
     2.    type x is access integer;
     3.    vx : x;
     4.    q : aliased integer;
     5. begin
     6.    vx := q'access;
                  |
        >>> result must be general access type
        >>> add "all" to type "x" declared at line 2

     7. end;

Actually we anticipate that a lot of users of GNAT version 2.02 will
be surprised by this new check (just wait till you get version 2.03
with the accessibility checks fully implemented :-)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: access all definitive
  1995-01-27  9:54 ` Michel Gauthier
@ 1995-01-28 19:48   ` Robert Dewar
  1995-01-30  5:24     ` Michael Feldman
  0 siblings, 1 reply; 6+ messages in thread
From: Robert Dewar @ 1995-01-28 19:48 UTC (permalink / raw)


fintan said:

"an access all type can only designate an aliased
variable and cannot designate a dynamic variable."

that's very wrong. an access all type can point to all things (why do you
think it uses all>? :-)

in particular, you can of course have a access all designate a dynamic
variable (i.e. one generated by an allocator).

one coding style that will develop in Ada 95 is simply to use all on all
access type declarations. However, I am not sure that is such a good idea,
one ought to minimize the use of aliased variables (there is a good reason
that Ada 83 did not have this feature, its overuse is definitely damaging)




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: access all definitive
  1995-01-28 19:48   ` Robert Dewar
@ 1995-01-30  5:24     ` Michael Feldman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Feldman @ 1995-01-30  5:24 UTC (permalink / raw)


In article <3ge71t$h4r@gnat.cs.nyu.edu>, Robert Dewar <dewar@cs.nyu.edu> wrote:
>fintan said:

>one coding style that will develop in Ada 95 is simply to use all on all
>access type declarations. However, I am not sure that is such a good idea,
>one ought to minimize the use of aliased variables (there is a good reason
>that Ada 83 did not have this feature, its overuse is definitely damaging)

And the Ada 95 Rationale (I think that is where I read it!) points out
that distinguishing the two types leads to potential optimizations,
because whereas a general access type (ACCESS ALL) will typically be
represented as a full address, a pool-specific (Ada 83) access type
might be able to use a more compact rep, since only a specific, probably
smaller, storage pool needs to be designated.

Mike Feldman



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1995-01-30  5:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-01-24 17:04 access all definitive fintan
1995-01-27  9:54 ` Michel Gauthier
1995-01-28 19:48   ` Robert Dewar
1995-01-30  5:24     ` Michael Feldman
1995-01-28  5:36 ` Cyrille Comar
1995-01-28  5:45 ` Robert Dewar

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