Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!decwrl!labrea!sri-unix!quintus!ok From: ok@quintus.uucp (Richard A. O'Keefe) Newsgroups: comp.lang.c Subject: Re: enums Message-ID: <218@quintus.UUCP> Date: 1 Aug 88 21:54:46 GMT References: <1608@dataio.Data-IO.COM> <469@m3.mfci.UUCP> <1988Jul22.171612.6225@utzoo.uucp> <5447@ihlpf.ATT.COM> <11686@steinmetz.ge.com> <2404@boulder.Colorado.EDU> Sender: news@quintus.UUCP Reply-To: ok@quintus.UUCP (Richard A. O'Keefe) Organization: Quintus Computer Systems, Inc. Lines: 18 In article <2404@boulder.Colorado.EDU> swarbric@tramp.Colorado.EDU (Frank Swarbrick) writes: :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. No it isn't. The Pascal fragment var: flag: (red, white, blue); ... flag := blue; flag := succ(blue); is *illegal* and any half-way decent Pascal system will give you a run-time error if you try it. (It's just the same in Ada.)