comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R.Carter" <spam.jrcarter.not@spam.acm.org.not>
Subject: Re: Constancy of X'Address?
Date: Fri, 7 Apr 2023 19:19:14 +0200	[thread overview]
Message-ID: <u0pjai$rl60$1@dont-email.me> (raw)
In-Reply-To: <k94t2nFelgbU1@mid.individual.net>

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

  parent reply	other threads:[~2023-04-07 17:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05  9:24 Constancy of X'Address? Niklas Holsti
2023-04-07 17:04 ` Maxim Reznik
2023-04-07 17:19 ` Jeffrey R.Carter [this message]
2023-04-08  9:03 ` Randy Brukardt
replies disabled

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