Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!rutgers!labrea!decwrl!decvax!mcnc!xanth!kent From: kent@xanth.UUCP (Kent Paul Dolan) Newsgroups: comp.lang.c Subject: Re: enum type Message-ID: <2238@xanth.UUCP> Date: Sun, 23-Aug-87 11:23:36 EDT Article-I.D.: xanth.2238 Posted: Sun Aug 23 11:23:36 1987 Date-Received: Mon, 24-Aug-87 03:48:31 EDT References: <2048@umn-cs.UUCP> <6311@brl-smoke.ARPA> Reply-To: kent@xanth.UUCP (Kent Paul Dolan) Organization: Old Dominion University, Norfolk Va. Lines: 29 Keywords: bleech! Summary: Omit initializers from enums. In article <6311@brl-smoke.ARPA> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >In article <2048@umn-cs.UUCP> smiller@umn-cs.UUCP (Steven M. Miller) writes: >>By the way does the ANSI C standard do anything new with enums? like >>provide succ(), pred(), lower(), and upper() functions that operate >>on enum types? > >No, X3J11 decided that enums have to act as integral types, so >one can use ++ etc. on them. If you want a general set or sequence >data type, you'll have to develop a package that implements it. (sorry Karl, I couldn't wait) Looks to me like whoever added enums to C got a bit carried away when they included intiializers. C already had a very nice and well #defined facility for named constants; the one created by allowing initializers with enum is redundant, and seems (from postings running back a month or so ago) to have created a headache for the standards process. Enums are a really nice idea, but as used in other languages, they provide a facility for replacing (usually integer) values with names, where the values _made_no_sense_, and only the fact that they could be distinguished (and possibly had an order) was important. C enums seem to have foundered by mixing two actually incompatible constructs in an effort to be "cute". Is it too late to remove this (to me blunder) from the definition of C? Kent, the man from xanth.