enums

Dennis Cohen drc at claris.UUCP
Wed Aug 3 00:11:04 AEST 1988


In article <5696 at haddock.ISC.COM> karl at haddock.ima.isc.com (Karl Heuer) writes:
>In <2404 at boulder.Colorado.EDU> swarbric at tramp (Frank Swarbrick) writes:
>>In <11686 at steinmetz.ge.com> davidsen at 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 --

It's not true of Pascal.  Both J&W and the ANSI/ISO standards explicitly state
that SUCC on the last element and PRED on the first element of an enumeration
are undefined and should produce an error condition.

Dennis Cohen
Claris Corp.
------------
Disclaimer:  Any opinions expressed above are _MINE_!



More information about the Comp.lang.c mailing list