Case Range Statement ..

Derek Parnell derek at psych.ward
Tue Jul 7 09:48:31 PDT 2009


On Tue, 07 Jul 2009 11:01:12 -0500, Andrei Alexandrescu wrote:

> To me they look the same, but if people are happier with wasting 
> vertical space, sure.

I think I've finally worked out why I don't like this syntax. Consider this
...


   switch (X) {
      case 1: funcA(); break;
      case 2,5,7,10 .. 17, 24, 32: funcB(); break;
      case 3,6,8,18 .. 23: funcC(); break;
   }

In other words, allowing a range of value inside a list of values.

How is this possible in today's D?

-- 
Derek Parnell
Melbourne, Australia
skype: derek.j.parnell



More information about the Digitalmars-d mailing list