in reply to Re^4: Control Structures
in thread Control Structures

Yes, do-while is a far worse problem, which is why we changed it to loop-while in Perl 6, and redefined do-block to make it the once-through loop (which conveniently makes it illegal to put a while on it).

I would also submit that the fallthrough of C switches falls into the category of bugs waiting to happen. Fallthrough is approximately the worst way to implement an "or". So that's not how Perl 6 will do it.

Another control flow fixup is to unify loop variables with closure parameters, so there's no longer any weird implicit blocking of special-purpose my variables.

Unifying switches with exception handlers will also prevent a bunch of "roll-your-own" control flow bugs in Perl 6.

If you count OO dispatch as a form of control flow (and I do), the roll-your-own OO support in Perl 5 also contributed to various forms of bugginess. One might go as far as to say that most of the fixups in Perl 6 consist of choosing better defaults (without making them mandatory).

Replies are listed 'Best First'.
Re^6: Control Structures
by demerphq (Chancellor) on May 11, 2005 at 15:05 UTC

    I would also submit that the fallthrough of C switches falls into the category of bugs waiting to happen.

    I read somewhere that at least one of the K&R pair is on record as saying that he regretted the fallthrough behaviour of switch, and that it would be one of the things he would do differently if he could. Unfortunatly I cant find a link right now, never did have very good google-fu.

    ---
    $world=~s/war/peace/g