comp.lang.ada
 help / color / mirror / Atom feed
* Accessibility levels
@ 1999-02-04  0:00 adam
  1999-02-04  0:00 ` Tucker Taft
  1999-02-05  0:00 ` adam
  0 siblings, 2 replies; 3+ messages in thread
From: adam @ 1999-02-04  0:00 UTC (permalink / raw)


I'm having trouble understanding the rules in 3.10.2.  Given the
following program:

    procedure Test is

       type T is record
          Field : Integer;
       end record;

       procedure Inner (Param : access T) is
          type Access_T is access all T;
          Var : Access_T;
       begin
          Var := Param.all'access;      -- [1]
       end Inner;

    begin
       Block1:
       begin
          Block2:
          begin
             Block3:
             begin
                Block4:
                declare
                   XXX : aliased T;
                begin
                   Inner (XXX'access);
                end Block4;
             end Block3;
          end Block2;
       end Block1;
    end Test;


The statement [1] is legal (i.e. no compile-time error or runtime
exception) as long as the accessibility level of Param.all is not
deeper than that of Access_T.  The accessibility level of Param.all is
the same as that of Param's type (3.10.2(15)), which is an anonymous access
type, whose accessibility level is the same as that of XXX
(3.10.2(13)).  Is this correct so far?

However, I can't find any rules that explicitly say whether the
accessibility level of XXX is deeper than that of Access_T, or vice
versa.  Or, since neither is declared in a scope that encloses (or is
identical to) the other, does this mean that *neither* XXX nor
Access_T has a deeper accessibility level than the other?  I'm not
sure just what the rules are trying to say here.  It seems that from
the general principles in 3.10.2(3), statement [1] should be legal;
but since the rest of the section takes a lot of care to spell things
out with mathematical precision, I'm afraid I must be missing
something because I can't find a precise statement to cover this case.

Note that I'm not at all interested in whether anything's
accessibility level is *statically* deeper than anything else's.

Thanks in advance for your help.

                                -- Adam

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




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

end of thread, other threads:[~1999-02-05  0:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-04  0:00 Accessibility levels adam
1999-02-04  0:00 ` Tucker Taft
1999-02-05  0:00 ` adam

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