Ary Borenszweig wrote:
Jesse Phillips escribió:
On Mon, 06 Jul 2009 14:38:53 -0500, Andrei Alexandrescu wrote:
Denis Koroskin wrote:
Reuse goto?
So any case-labeled code should end either with a control flow statement
that transfers control elswhere? That sounds like a great idea.
Fall-through is so rare and so rarely intended, it makes sense to
require the programmer to state the intent explicitly via a goto case.
Andrei
The goto method already works, the only change needed would be to not
have fallthru default.
http://digitalmars.com/d/2.0/statement.html#GotoStatement
But that's kind of redundant:
case 1: goto case 11:
case 11: goto case 111:
case 111: goto case 1111:
case 1111:
doIt();
don't you think?
Maybe http://msdn.microsoft.com/en-us/vcsharp/aa336815.aspx .
If you change the case expression, you must change it twice.
Why not:
case 1: continue case;
case 11: continue case;
etc.?