case statements

Ellery Newcomer ellery-newcomer at utulsa.edu
Sat Oct 10 20:53:41 PDT 2009


Jarrett Billingsley wrote:
> On Sat, Oct 10, 2009 at 8:45 PM, Ellery Newcomer
> <ellery-newcomer at utulsa.edu> wrote:
>> This is probably a bad idea
> 
> A single string mixin must consist of an entire, fully-formed
> statement, expression, or declaration (depending on where it's used).
> Case labels do not, on their own, count as a statement.

Yeah they do. Ever wonder why you can do things like duff's device? Or

case 1:
case 2:

or

switch(x){
case 3:
}

> 
> In addition, there is a bug that prevents you from string-mixing-in
> cases inside a switch. For some reason you have to mix in the entire
> switch statement.


http://d.puremagic.com/issues/show_bug.cgi?id=1534

Hey! there's even a patch for it! And it works! Rainier, you da man!


More information about the Digitalmars-d-learn mailing list