comp.lang.ada
 help / color / mirror / Atom feed
From: rgilbert@polaris.orl.mmc.com (Bob Gilbert)
Subject: Re: Question about record rep spec placement
Date: 1997/01/15
Date: 1997-01-15T00:00:00+00:00	[thread overview]
Message-ID: <5bjag6$k7d@zeus.orl.mmc.com> (raw)
In-Reply-To: 32DCFDAA.2656@lmtas.lmco.com


In article <32DCFDAA.2656@lmtas.lmco.com>, Ken Garlington <GarlingtonKE@lmtas.lmco.com> writes:
> We have some Ada83 code that looks like the following:
> 
> package Some_Package is
> 
>   type Some_Record is record
>    -- components here
>   end record;
> 
>   -- some arbitrary declarations here
> 
> private
> 
>   for Some_Record use record
>    -- component rep spec here
>   end record;
> 
> end;
> 
> Are there cases in Ada where a record representation specification
> cannot be deferred until the private part of the package? I'm told that
> when this code was compiled with an Ada 95 compiler, that the record
> rep spec had to be moved to immediately after the record declaration
> for the code to compile correctly. I'm wondering if this is
> 
>   (a) illegal Ada83 code that our Ada83 compiler accepted anyway
>       (much like the use of unchecked_conversion on the left-hand side
>       of an assignment statement, as described in another thread),
> 
>   (b) legal Ada code that the other Ada compiler rejected anyway, or
> 
>   (c) OUCH! Ada83 code that is no longer valid Ada.

I'm pretty sure (a) is the answer (a representation clause must occur
in the same declaration list as the entity it refers to, and I believe 
that the private section constitutes a different declaration list), 
but regardless....

What possible purpose would placing the record rep spec in the
private section serve when the record is not a private type?

-Bob

























  parent reply	other threads:[~1997-01-15  0:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-01-15  0:00 Question about record rep spec placement Ken Garlington
1997-01-15  0:00 ` Norman H. Cohen
1997-01-16  0:00   ` Ken Garlington
1997-01-17  0:00     ` Robert A Duff
1997-01-18  0:00       ` Ken Garlington
1997-01-15  0:00 ` Bob Gilbert [this message]
1997-01-16  0:00   ` Fergus Henderson
1997-01-17  0:00   ` Ken Garlington
1997-01-17  0:00     ` Bob Gilbert
1997-01-17  0:00       ` Robert A Duff
1997-01-17  0:00         ` Ken Garlington
1997-01-18  0:00           ` Robert A Duff
1997-01-18  0:00             ` Ken Garlington
1997-01-19  0:00               ` Robert A Duff
1997-01-21  0:00         ` Bob Gilbert
1997-01-22  0:00           ` Ken Garlington
1997-01-23  0:00             ` Art Schwarz
1997-01-25  0:00               ` Ken Garlington
1997-01-24  0:00             ` Bob Gilbert
1997-01-25  0:00               ` Ken Garlington
1997-01-20  0:00       ` Ken Garlington
1997-01-16  0:00 ` Jeff Creem
1997-01-16  0:00 ` Jerome Desquilbet
replies disabled

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