From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.0 required=3.0 tests=BAYES_40 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 30 Jul 91 12:35:22 GMT From: cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wupost!waikato.ac.nz!comp.vu w.ac.nz!canterbury.ac.nz!cantua!rjm@ucbvax.Berkeley.EDU (insane) Subject: Question on enumeration types Message-ID: <1991Jul31.003524.1589@csc.canterbury.ac.nz> List-Id: In an article I'm currently reading [David Moffat; "Enumerations in Pascal, Ada , and Beyond"; from: SIGPLAN 16.2 1981 pp77-82] there is an example which invol ves two anonymous declarations of the same enumeration type: flag: (up, down); and semaphore: (up, down); ('semaphore' may have been defined in the same or a nested scope). Moffat then states that neither variable can be used, "... because any occurren ces of the constants 'up' and 'down' must now be disambiguated by qualification with their type names - which do not exist in this case." I have looked in the Dept. of Defense Reference Manual, and it appears that Moffat may not be right . As I (and a lecturer I consulted) interpret the manual, the context that a co nstant, such as 'up', is used in should determine which declaration is the corr ect one to use. For example, semaphore := up; - it is clear from the context that the second declaration is the correct one to use. Hence, no ambiguity exists. Is this the correct interpretation, or is Moffat in the right here? Thanks, Ray [%-) -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ \"""/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~ 0 0 ~~~~~~~~~~~~ rjm@cosc.canterbury.ac.nz ~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ v ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~ " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~