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
Date: 30 Jul 91 12:35:22 GMT [thread overview]
Message-ID: <1991Jul31.003524.1589@csc.canterbury.ac.nz> (raw)
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 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~ " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
next reply other threads:[~1991-07-30 12:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1991-07-30 12:35 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!wupost!waikato.ac.nz!comp.vu [this message]
-- strict thread matches above, loose matches on Subject: below --
1991-07-31 23:46 Question on enumeration types Charles H. Sampson
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox