comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Ada95: at clause - 'Address
Date: 1996/10/18
Date: 1996-10-18T00:00:00+00:00	[thread overview]
Message-ID: <DzHIE5.9o8@world.std.com> (raw)
In-Reply-To: 3267958B.41C6@erols.com


In article <3267958B.41C6@erols.com>,
Ramesh Sadasivam  <madurai@erols.com> wrote:
>In Ada95 I guess the "at clause" has been replaced with the 'Address.

The "at clause" still exists, but is considered obsolescent.
"for X use at Y;" means exactly the same thing as "for X'Address use Y;",
but the second syntax is considered preferable.  But if you have
existing Ada 83 code, there is no need to modify it to use the second
syntax.

>    ITEM_ADDRESS : SYSTEM.ADDRESS := ITEM; 

You need to make this a constant.  In your CASE 1, the address was an
'in' parameter, which is a constant, so it worked.  This is not a hard
rule of Ada, but an allowed restriction.  I think the GNAT error message
points you to the right RM paragraph.

The rule is that in portable code, if you want to say "for X'Address use
Y;", make sure Y is a constant, and that it is declared before X.

- Bob




  reply	other threads:[~1996-10-18  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-18  0:00 Ada95: at clause - 'Address Ramesh Sadasivam
1996-10-18  0:00 ` Robert A Duff [this message]
1996-10-19  0:00 ` Robert Dewar
replies disabled

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