From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a00ff2b882a06fda X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: HELP: renames and enum values Date: 2000/04/11 Message-ID: <38F388B3.9E1BDE1@averstar.com>#1/1 X-Deja-AN: 609795586 Content-Transfer-Encoding: 7bit References: <38ECE0EB.4BD4A53E@mindspring.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@inmet2.burl.averstar.com X-Trace: inmet2.burl.averstar.com 955484339 10226 141.199.8.164 (11 Apr 2000 20:18:59 GMT) Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 NNTP-Posting-Date: 11 Apr 2000 20:18:59 GMT Newsgroups: comp.lang.ada Date: 2000-04-11T20:18:59+00:00 List-Id: 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