From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,2e81f53ebf2045a3,start X-Google-Attributes: gid103376,public From: adam@irvine.com Subject: Accessibility levels Date: 1999/02/04 Message-ID: <79d460$abm$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 440727618 X-Http-Proxy: 1.0 x15.dejanews.com:80 (Squid/1.1.22) for client 192.160.8.21 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Thu Feb 04 21:41:23 1999 GMT Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/3.0 (X11; I; Linux 2.0.34 i686) Date: 1999-02-04T00:00:00+00:00 List-Id: 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