Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!lll-winken!lll-lcc!ames!ncar!boulder!tramp!swarbric From: swarbric@tramp.Colorado.EDU (Frank Swarbrick) Newsgroups: comp.lang.c Subject: Re: enums Message-ID: <2404@boulder.Colorado.EDU> Date: 31 Jul 88 07:32:54 GMT Article-I.D.: boulder.2404 References: <1608@dataio.Data-IO.COM> <469@m3.mfci.UUCP> <1988Jul22.171612.6225@utzoo.uucp> <5447@ihlpf.ATT.COM> <11686@steinmetz.ge.com> Sender: news@boulder.Colorado.EDU Reply-To: swarbric@tramp.Colorado.EDU (Frank Swarbrick) Organization: Beautiful Boulder By The Bay Lines: 30 In article <11686@steinmetz.ge.com> davidsen@crdos1.UUCP (bill davidsen) writes: >Here are my ideas on how an enum should work. Obviously no one gave me >definitive insight, so consider this as opinion from someone who's been >using computers for a while. If it looks a lot like Pascal, perhaps >that portion of the language is more useful than the bulk of it. > >- enums should be a sequence of values in increasing order. The values > should start at zero and increase by one. This allows the ++ and -- > operators to be used in a meaningful way. Personally, I would like it to be even a little more like Pascal. Let's say I have typedef enum {red, white, blue} flag_colors; I would like: { flag_colors flag; flag = blue; flag++; } to have it so flag is now red. This is like Pascal's succ() and pred() operators. Frank Swarbrick (and, yes, the net.cat) swarbric@tramp.Colorado.EDU ...!{ncar|nbires}!boulder!tramp!swarbric "You shouldn't kill your brother -- except if he doesn't know what's right. If he can't love your heaven, ahh, it's a mercy for him to die." --Accept