Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site ucsfcgl.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!zehntel!dual!amd!decwrl!decvax!ucbvax!ucsfcgl!arnold From: arnold@ucsfcgl.UUCP (Ken Arnold%UCB) Newsgroups: net.lang.c Subject: Re: ANSI standard and enums Message-ID: <369@ucsfcgl.UUCP> Date: Wed, 24-Oct-84 13:07:43 EST Article-I.D.: ucsfcgl.369 Posted: Wed Oct 24 13:07:43 1984 Date-Received: Sun, 28-Oct-84 05:54:55 EST References: <4125@tekecs.UUCP> Organization: Computer Graphics Lab, San Francisco Lines: 39 > I would like to pose a question to the user community. > What position should the ANSI committee take regarding enumerated types? > a. leave them out of the language > b. "tighten up" enums so they behave less like regular ints > c. leave them wishy-washy like they're implemented in many compilers > > This is not a joke. The question to even have them in the language is > valid. The only real use for enums that we could see was to provide > symbolic names for constants so that symbolic debuggers could access them. > Other than that, it appears that enums could be replaced with appropriate > #defines. I always thought that the most useful potential use for enum's was to replace "appropriate" #define's. Not only is it a regular pain to type 30 or 50 equivalents of # define A 1 # define C 2 . . . . but adding new ones in order is a real pain. For example, adding a definition of "B" to the above list in alphabetical order requires renumbering "C" and everything after must be renumbered if the numerical ordering is to match to actual order (which makes sorting easier). With enums, just an insertion into the list will do the same job. The idea of having constant available to debuggers by name is nice, too, but not as functional. So I would add d. make enum constants be considered exactly like integer constants. Although you can get away with this kind of usage, lint complains like hell about using enum constants for subscripts, etc. I would agree that the current implementation is half-assed and doesn't really solve any problem. I would argue that either enums should equal integers or they should be deleted. Ken Arnold