>
I’d like to use switch instead of some new construct
Switch is a very thorny contraption, it's a remnant of an older time and it's just not good language design. Switch cases falling through are bug-prone and everyone runs into problems with "error: jump to case label crosses initialization of xyz" etc. The mere notion of able to write nonsense like the following is not a good thing:
switch(n) {
while(n--) {
case 10:
foo(n);
case 20:
bar();
default:;
}
}
Switch will never go away, but we should move to something better.
Jeremy