Lang. suggestion: auto-fallthrough and comparison shorthands

Rioshin an'Harthen rharth75 at hotmail.com
Sat Jul 1 05:36:16 PDT 2006


"Frank Benoit" <keinfarbton at nospam.xyz> wrote:
> But there is a inconsistence:
>
> switch( i ){
> case 0:
> ...
> case 1: // problem with implicit break
> case 2:
> ...
> default:
> ...
> }
>
> should become:
> switch( i ){
> case 0:
> ...
> case 1, 2: // this solves the problem
> ...
> default:
> ...
> }

Or even borrow a bit from array slices, and do something akin to

case 1..4, 8..12:

to have it trigger on 1, 2, 3, 4, 8, 9, 10, 11 and 12. 





More information about the Digitalmars-d mailing list