Path: utzoo!attcan!uunet!convex!killer!ames!mailrus!tut.cis.ohio-state.edu!husc6!necntc!ima!haddock!karl From: karl@haddock.ISC.COM (Karl Heuer) Newsgroups: comp.lang.c Subject: Re: enums Message-ID: <5696@haddock.ISC.COM> Date: 1 Aug 88 17:32:15 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> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Boston Lines: 16 In <2404@boulder.Colorado.EDU> swarbric@tramp (Frank Swarbrick) writes: >In <11686@steinmetz.ge.com> davidsen@crdos1.UUCP (bill davidsen) writes: >>[enums should be in sequence, so ++ and -- can be used meaningfully] > >Personally, I would like it to be even a little more like Pascal. [++ on the >last item should wrap to the first.] This is like Pascal's succ() and pred() I rather doubt that this is true of Pascal -- I've never heard of it before -- but I don't claim to be a Pascal expert, and anyway it doesn't affect my reply. I *don't* think it should be true of C, because it violates the principle of keeping the primitives simple. Most applications don't need the wraparound behavior, and it does have a nontrivial cost, therefore the ++ operator should simply step by one (with undefined behavior if you step off the end). Karl W. Z. Heuer (ima!haddock!karl or karl@haddock.isc.com), The Walking Lint