Enumerated types... what's the point?

Wm E. Davidsen Jr davidsen at sixhub.UUCP
Sun Mar 25 08:46:22 AEST 1990


In article <1990Mar22.164943.10459 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:

| Enumerated types were basically a kludge.  X3J11 seriously debated leaving
| them out entirely.  Arguments about not breaking existing code, etc, led
| to them being left in, but as a flavor of integer rather than as real live
| independent types.  That's all they ever were in C.

  A real kludge! Someone at an X3J11 meeting told me that enums were
added to the language by someone because the preprocessor was out of
symbol table and it was easier to hack the compiler than to expand the
preprocessor to allow more defines. I can't swear that's true, but no
one at the table seemed to find the idea shocking, unlikely, or even
new.

  I would really like to see a real enum in C, one of the things I think
was really done badly in the name of not breaking existing programs.

  I was told that enums as I wanted them were "thinking like Pascal,"
and "not in the spirit of C." Majority rules.
-- 
bill davidsen - davidsen at sixhub.uucp (uunet!crdgw1!sixhub!davidsen)
    sysop *IX BBS and Public Access UNIX
    moderator of comp.binaries.ibm.pc and 80386 mailing list
"Stupidity, like virtue, is its own reward" -me



More information about the Comp.lang.c mailing list