From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Sun, 7 Feb 2010 17:37:51 -0500 To: 9fans@9fans.net Message-ID: In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] NaN, +Inf, and -Inf, constants? Topicbox-Message-UUID: d02607d8-ead5-11e9-9d60-3106f5b1d025 > 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