From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Constancy of X'Address? Date: Fri, 7 Apr 2023 19:19:14 +0200 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 7 Apr 2023 17:19:14 -0000 (UTC) Injection-Info: dont-email.me; posting-host="f74ee5803648d83e8f93680e4ea9472e"; logging-data="906432"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18XiqckiuLqsDRIdeYzl2vllKpLRpvBR0M=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Cancel-Lock: sha1:BX6A65bUc3t5VzcVbTGQbAwq8/0= In-Reply-To: Content-Language: en-US Xref: feeder.eternal-september.org comp.lang.ada:65076 List-Id: On 2023-04-05 11:24, Niklas Holsti wrote: > > - Is the address of an object constant in Ada? That is, if I have some object X > in an Ada program, do repeated applications of X'Address always return the same > value? > > - Does the answer depend on how X is allocated (created): on the library level, > on the stack, or in a pool ("new")? 'Address is discussed in ARM 13.3 (http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-13-3.html). (12.c) says "The validity of a given address depends on the run-time model; thus, in order to use Address clauses correctly, one needs intimate knowledge of the run-time model." Under Implementation Advice, (15-16) say "The recommended level of support for the Address attribute is: "X'Address should produce a useful result if X is an object that is aliased or of a by-reference type, or is an entity whose Address has been specified." There is nothing specific about whether the value can change. -- Jeff Carter "We'll make Rock Ridge think it's a chicken that got caught in a tractor's nuts!" Blazing Saddles 87