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.1 required=5.0 tests=BAYES_40,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!uunet!lll-winken!lll-lcc!ames!pasteur!ucbvax!software.ORG!harrison From: harrison@software.ORG (Tim Harrison) Newsgroups: comp.lang.ada Subject: Re: Visibility question Message-ID: <8809160044.AA20507@ajpo.sei.cmu.edu> Date: 15 Sep 88 20:36:42 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet 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; >> 13 second_enum : Enum_Type := Enum_Type'(three); >> 14 third_enum : Test_Pack_One.Enum_Type := >> 15 Test_Pack_One.Enum_Type'(three); >> 16 >> 17 end Test_Pack_Two; Two solutions without a USE clause were provided by Fred Hosch . Another possible solution is: package Test_Pack_One is type Enum_Type is (one, three, five, seven, nine); end Test_Pack_One; with Test_Pack_One; package Test_Pack_Two is subtype Enum_Type is Test_Pack_One.Enum_Type; function three return Test_Pack_One.Enum_Type renames Test_Pack_One.three; first_enum : Enum_Type := three; end Test_Pack_Two; -- Tim Harrison Software Productivity Consortium Phone: (703) 391-1742 1880 Campus Commons Drive, North CSnet: harrison@software.org Reston, Virginia 22091 ARPAnet: harrison@ajpo.sei.cmu.edu