comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: HELP: renames and enum values
Date: 2000/04/11
Date: 2000-04-11T20:18:59+00:00	[thread overview]
Message-ID: <38F388B3.9E1BDE1@averstar.com> (raw)
In-Reply-To: 38ECE0EB.4BD4A53E@mindspring.com

Al Johnston wrote:
> 
> I am having a little trouble with the following:
> 
> package EU_AG.ET.Dsc is
> 
>   type OvrRd0State_Typ is (OVERRIDE_OFF,OVERRIDE_ON);
>   for  OvrRd0State_Typ'size use integer'size;
>   for  OvrRd0State_Typ use (OVERRIDE_OFF => 0,OVERRIDE_ON  => 1);
> end EU_AG.ET.Dsc;
> 
> with EU_AG.ET.Dsc;
> package SK_Types.Dsc is
>   package EU_AGETDsc renames EU_AG.ET.Dsc;
>   subtype OvrRd0State_Typ is EU_AGETDsc.OvrRd0State_Typ;
> end SK_Types.Dsc;
> 
> with SK_Types.Dsc;
> package THREE is
>   foo : SK_Types.Dsc.OvrRd0State_Typ := SK_Types.Dsc.OVERRIDE_OFF;
> end THREE;
> 
> When I compile "THREE" the compiler complains that "OVERRIDE_OFF" is not
> 
> declared in "Dsc".  I could get around this by renaming each of the enum
> values
> (that is adding OVERRIDE _OFF renames EU_AG.ET.Dsc.OVERRIDE_OFF;
> to the sk_types.dsc package spec,) but that would be pretty nasty for a
> large
> enum type... plus the fact that it totally defeats the point of package
> in the first place.
> 
> Any one know of a better way of doing the reference to OVERRIDE_OFF in
> the package THREE?

One way would be to move the enumeration type declaration into
a subpackage all by itself.  You could then rename this subpackage
rather than the enumeration type itself, and all references to the 
enumeration type and the enumeration literals would uniformly 
use the subpackage name as a prefix.

> thanks,
> 
> -al

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




      parent reply	other threads:[~2000-04-11  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <38ECE0EB.4BD4A53E@mindspring.com>
2000-04-07  0:00 ` HELP: renames and enum values Samuel T. Harris
2000-04-07  0:00   ` Al Johnston
2000-04-09  0:00     ` Robert Dewar
2000-04-09  0:00       ` dale
2000-04-09  0:00         ` Robert Dewar
2000-04-10  0:00           ` Dale Stanbrough
2000-04-13  0:00             ` John English
2000-04-13  0:00               ` Ted Dennison
2000-04-13  0:00                 ` Samuel T. Harris
2000-04-13  0:00                 ` Robert A Duff
2000-04-13  0:00               ` Robert Dewar
2000-04-14  0:00                 ` John English
2000-04-13  0:00               ` Samuel T. Harris
2000-04-14  0:00               ` Tucker Taft
2000-04-10  0:00       ` Samuel T. Harris
2000-04-11  0:00       ` Al Johnston
2000-04-10  0:00     ` Samuel T. Harris
2000-04-11  0:00       ` Al Johnston
2000-04-11  0:00 ` Tucker Taft [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