switch case for constants-only?

Ellery Newcomer ellery-newcomer at utulsa.edu
Sat Dec 5 15:43:02 PST 2009


On 12/05/2009 04:19 PM, Nick Sabalausky wrote:
> "Ellery Newcomer"<ellery-newcomer at utulsa.edu>  wrote in message
>>
>> More so than remembering to type break after each case block?
>
> Good point, but that's really a separate issue.
>
>

I don't know about that. The issue seems to be you want switch to behave 
in a manner unlike that of any other language that I know of.
It's different. It breaks convention.

It's a useful divergence. It's a feature that should exist. But I 
contend it makes more sense to make a new construct which *is* 
equivalent to a certain pattern of nested ifs (switch isn't) and 
incorporate your feature into that than to shoehorn it into switch.



More information about the Digitalmars-d mailing list