From: James B Crigler Date: 2004-07-07T23:02:43+09:00 Subject: Re: Enumeration (Ala Pascal, C, Ada) Tim Hunter wrote: > > James B Crigler wrote: > > > I put together the code that follows in an attempt to emulate (in a > > crude way) the "enumeration" types of Ada, C, Pascal, etc. > > I don't know if this is exactly what you're looking for, but check out > http://addlib.rubyforge.org/wiki/wiki.pl?EnumClass. This is a class that is > to C enums what Struct is to C structures. Thanks, Tim. I did a copy and paste of the code from the wiki, and it is very interesting. I hadn't thought of the runtime definition of Enum subclasses --- that's a very nice touch. Unfortunately, my problem is a little different. Buried in what I originally wrote is this statement: > Multiple change doc types with disjoint status sets may be used > simultaneously. I misstated the case here: The status sets may have a few identical names, e.g., an Edibles could have a set of statuses like "CUT", "INSERT", "CHEW", "SWALLOW", "DIGEST" while a Readables class could have a set of statuses like "OPEN", "READ", "CONSIDER", "DIGEST", "MEDITATE" Your Enum solution can't prevent me from comparing these two. -- Jim Crigler