Re: Enumeration data type

"Tim Van Holder" <tim.vanholder@falconsoft.be>
19 Jan 2001 23:17:52 -0500

          From comp.compilers

Related articles
Enumeration data type irobot@swbell.net (Brian Webb) (2001-01-18)
Re: Enumeration data type iRobot@swbell.net (Brian Webb) (2001-01-19)
Re: Enumeration data type tim.vanholder@falconsoft.be (Tim Van Holder) (2001-01-19)
Re: Enumeration data type kszabo@nortelnetworks.com (Kevin Szabo) (2001-01-19)
Re: Enumeration data type mike@dimmick.demon.co.uk (Mike Dimmick) (2001-01-19)
| List of all articles for this month |

From: "Tim Van Holder" <tim.vanholder@falconsoft.be>
Newsgroups: comp.compilers
Date: 19 Jan 2001 23:17:52 -0500
Organization: Falcon Software NV
References: 01-01-081
Keywords: types
Posted-Date: 19 Jan 2001 23:17:52 EST

In a burst of inspiration, "Brian Webb" <irobot@swbell.net> wrote


> They're like enumerations, except that values may be assigned and data
> types other than integer can be used.
>
> enumeration Color_Code is integer
> Black = 0 Red = 1 Green = 2 Blue = 8 White = 16
> end enumeration Color_Code


I'd say `valuegroup' if they're variable, or `constantgroup' if they're
constant (as enums in C). `group' by itself is probably too generic
and would cause confusion wrt sets.


valuegroup Posters is Karma
    Troll = -3
    Flamebait = -1
    Anonymous_Coward = 0
    Normal = 1
    Karma_King = 3
end valuegroup Posters


--
Tim Van Holder - Falcon Software N.V.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.