Andrei Alexandrescu, el 21 de junio a las 15:25 me escribiste: > On 06/21/2010 01:27 PM, Sean Kelly wrote: > >Jonathan M Davis Wrote: > >> > >>In any case, that means that it could be made required to have a control > >>statement at the end of a case block without having to specify a specific > >>destination for fallthrough - though I'd prefer "continue switch" over "goto > >>case" since it's more explicit and less error prone (since there's no doubt > >>that you didn't intend to put a destination for the goto if you use > >>"continue switch" instead of a "goto case" without a destination). > > > >It's a small thing, but I think "continue switch" could be misleading. > >Consider this: > > > >switch (getState()) { > >case X: > > setState(Z); > > continue switch; > >case Y: > > break; > >case Z: > > writeln( "done!" ); > >} > > > >Having never encountered D before, what would be your interpretation of this > >code? > > Well looks pretty good to me to be honest.
goto next case; is a little more verbose but very clear to me :) Maybe just next case; is a shorter alternative... -- Leandro Lucarella (AKA luca) http://llucax.com.ar/ ---------------------------------------------------------------------- GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05) ---------------------------------------------------------------------- CONDUCTOR BORRACHO CASI PROVOCA UNA TRAGEDIA: BATMAN UNICO TESTIGO -- Crónica TV