comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Predefined Language Attributes 'ADDRESS and 'ACCESS
Date: Thu, 6 Dec 2018 17:43:37 +0100
Date: 2018-12-06T17:43:37+01:00	[thread overview]
Message-ID: <pubjjp$ii1$1@dont-email.me> (raw)
In-Reply-To: <5c08c0d3$0$7083$e4fe514c@news.kpn.nl>

On 12/6/18 7:25 AM, ldries46 wrote:
> What is the principal difference between the Attributes 'ADDRESS and 'ACCESS? 
> When do you use them?

The principal difference is that 'Address returns a value of type System.Address 
and 'Access returns a value of an access type. They are not the same and there 
is not necessarily any relationship between them.

 From ARM K.2(2-7) Language-Defined Attributes:

2
P'Access
For a prefix P that denotes a subprogram:
3
P'Access yields an access value that designates the subprogram denoted by P. The 
type of P'Access is an access-to-subprogram type (S), as determined by the 
expected type. See 3.10.2.
4
X'Access
For a prefix X that denotes an aliased view of an object:
5
X'Access yields an access value that designates the object denoted by X. The 
type of X'Access is an access-to-object type, as determined by the expected 
type. The expected type shall be a general access type. See 3.10.2.
6/1
X'Address
For a prefix X that denotes an object, program unit, or label:
7
Denotes the address of the first of the storage elements allocated to X. For a 
program unit or label, this value refers to the machine code associated with the 
corresponding body or statement. The value of this attribute is of type 
System.Address. See 13.3.

http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-K-2.html

-- 
Jeff Carter
"Why, the Mayflower was full of Fireflies, and a few
horseflies, too. The Fireflies were on the upper deck,
and the horseflies were on the Fireflies."
Duck Soup
95

      parent reply	other threads:[~2018-12-06 16:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-06  6:25 Predefined Language Attributes 'ADDRESS and 'ACCESS ldries46
2018-12-06  9:56 ` Dmitry A. Kazakov
2018-12-06 16:43 ` Jeffrey R. Carter [this message]
replies disabled

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