> enum {
>       a = 1,
>       b = 2.44000000000000000000618549L,
>       c = 2.44F,
>       d = "this is weird",
>       e = 1LL<<62,
> } foo;
> 
> How on earth do you switch() on it? And what's its sizeof()?

why does being able to switch on any enum trump
the ability to define constants without #define?

if you try, sizeof(foo)==4, but you'll need to remove
'd' since you can't have a string.  you can't switch on
a vlong or float.  would be nice, though.

the plan 9 style is never to typedef or name enums.
(though i saw one creep into the source recently.)
so the sizeof problem would naturally never come up.
if it were an error to name or typedef an enum
containing non-int members, there would be no
problem.

- erik

Reply via email to