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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!husc6!cs.utexas.edu!fred From: fred@cs.utexas.edu (Fred Hosch) Newsgroups: comp.lang.ada Subject: Re: Visibility question Keywords: enumerated, import, subtype Message-ID: <3326@cs.utexas.edu> Date: 14 Sep 88 15:12:48 GMT References: <2223@ssc-vax.UUCP> Organization: U. Texas CS Dept., Austin, Texas List-Id: In article <2223@ssc-vax.UUCP>, adolph@ssc-vax.UUCP (Mark C. Adolph) writes: > Given the following package specs, I'm getting errors which I'm > confused about: > > 1 package Test_Pack_One is > 2 > 3 type Enum_Type is (one, three, five, seven, nine); > 4 > 5 end Test_Pack_One; > 6 > 7 with Test_Pack_One; > 8 package Test_Pack_Two is > 9 > 10 subtype Enum_Type is Test_Pack_One.Enum_Type; > 11 > 12 first_enum : Enum_Type := three; ... LRM 3.5.1 states "this declaration (of an enumeration literal) is equivalent to the declaration of a parameterless function..." Either of the following will do without a use-clause: package TEST_PACK_ONE is type ENUM_TYPE is (ONE, THREE, FIVE, SEVEN); end TEST_PACK_ONE; with TEST_PACK_ONE; package TEST_PACK_TWO is subtype ENUM_TYPE is TEST_PACK_ONE.ENUM_TYPE; FIRST_ENUM: ENUM_TYPE := TEST_PACK_ONE.THREE; end TEST_PACK_TWO; or package TEST_PACK_ONE is type ENUM_TYPE is (ONE, THREE, FIVE, SEVEN); end TEST_PACK_ONE; with TEST_PACK_ONE; package TEST_PACK_TWO is type ENUM_TYPE is new TEST_PACK_ONE.ENUM_TYPE; FIRST_ENUM: ENUM_TYPE := THREE; end TEST_PACK_TWO; --- Fred Hosch fred@cs.utexas.edu