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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b0ed9912e5828c24,start X-Google-Attributes: gid103376,public From: "Kevin F. Quinn" Subject: Scope of identifiers Date: 1996/04/17 Message-ID: <3174F2AF.1C4@banana.demon.co.uk>#1/1 X-Deja-AN: 147986213 x-nntp-posting-host: cdc.demon.co.uk content-type: text/plain; charset=us-ascii organization: Computing Devices mime-version: 1.0 reply-to: kevq@banana.demon.co.uk newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (Win16; I) Date: 1996-04-17T00:00:00+00:00 List-Id: Is there a way (I've looked and can't find one) of informing an Ada compiler that a prefix is a package? The following (contrived) code example illustrates: package Pong is procedure Neutralise; end Pong; with Pong; procedure OdourControl is type Smells is (Pong, Whiff); Smell : Smells; begin Smell := Pong; Pong.Neutralise; end OdourControl; Now; as a human, I can identify immediately that "Pong.Neutralise" is intended to mean "call procedure Neutralise from package Pong". Unfortunately, the above code generates a semantic error, as when parsing the "Pong.Neutralise", the meaning of Pong is taken to be that of the enumeration literal, which is eclipsing the package Pong. If it were the other way round, where the package name were in the more immediate scope, one could write Smells'Pong to get at the enumeration literal. Is there anything similar which can explicitly tell the compiler that an identifier is a package? As an aside, are there any situations where an enumeration literal makes any sense at all as an lvalue? I can't think of any... Cheers, Kev.